From 092f90974738340947a3f6e386b63cfa0e46e621 Mon Sep 17 00:00:00 2001 From: bionutrient Date: Thu, 1 Sep 2016 13:49:20 -0400 Subject: [PATCH] added sudo and some error fix language sudo su is needed on raspberry pi to create the systemd service file if the file is initially created using the wrong directory for hass, then the file, at least when I did it, needed to be removed, and systemctl reloaded prior to fixing the service file. --- source/getting-started/autostart-systemd.markdown | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/source/getting-started/autostart-systemd.markdown b/source/getting-started/autostart-systemd.markdown index f3e90be59598..744bc59baa85 100644 --- a/source/getting-started/autostart-systemd.markdown +++ b/source/getting-started/autostart-systemd.markdown @@ -20,7 +20,7 @@ If the preceding command returns the string `systemd`, you are likely using `sys If you want Home Assistant to be launched automatically, an extra step is needed to setup `systemd`. You need a service file to control Home Assistant with `systemd`. If you are using a Raspberry Pi with Raspbian then replace the `[your user]` with `pi` otherwise use your user you want to run Home Assistant. `ExecStart` contains the path to `hass` and this may vary. Check with `whereis hass` for the location. ```bash -$ su -c 'cat <> /etc/systemd/system/home-assistant@[your user].service +$ sudo su -c 'cat <> /etc/systemd/system/home-assistant@[your user].service [Unit] Description=Home Assistant After=network.target @@ -63,6 +63,13 @@ $ sudo systemctl status home-assistant@[your user] -l [...] ``` +IF, you get an error message, and it fails to start Home Assistant, double check that your ExecStart=/usr/bin/hass points to the correct location...it's likely ExecStart=/usr/local/bin/hass If you didn't update it correctly, you may have to remove the home-assistant@pi.service file and then start over at the top of this instruction set using the correct directory. + +'''bash +$ sudo rm /etc/systemd/system/home-assistant@pi.service +$ sudo systemctl --system daemon-reload +''' + To get Home Assistant's logging output, simple use `journalctl`. ```bash