You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Updated docs based on user suggestions
Thanks to @NeLLyMerC for the suggestions. Removed the EOF syntax for creating a file. Cleaned up the description of the systemctl commands. Added 'sudo' to the journalctl commands as it will not show the logs if running as an unprived user.
* Update systemd.markdown
Copy file name to clipboardExpand all lines: source/_docs/autostart/systemd.markdown
+28-30Lines changed: 28 additions & 30 deletions
Original file line number
Diff line number
Diff line change
@@ -18,45 +18,28 @@ $ ps -p 1 -o comm=
18
18
19
19
If the preceding command returns the string `systemd`, you are likely using `systemd`.
20
20
21
-
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.
21
+
If you want Home Assistant to be launched automatically, an extra step is needed to setup `systemd`. A service file is needed to control Home Assistant with `systemd`. The template below should be created using a text editor. Note, root permissions via 'sudo' will likely be needed. The following should be noted to modify the template:
22
22
23
-
```bash
24
-
$ su -c 'cat <<EOF >> /etc/systemd/system/home-assistant@.service
25
-
[Unit]
26
-
Description=Home Assistant
27
-
After=network.target
28
-
29
-
[Service]
30
-
Type=simple
31
-
User=%i
32
-
ExecStart=/usr/bin/hass
23
+
+`ExecStart` contains the path to `hass` and this may vary. Check with `whereis hass` for the location.
24
+
+ If running Home Assistant in a python virtual environment or a docker, please skip to section below.
25
+
+ For most systems, the file is `/etc/systemd/system/home-assistant@[your user].service` with [your user] replaced by the user account that Home Assistant will run as - normally `homeassistant`. For Ubuntu 16.04, the file is `/lib/systemd/system/home-assistant.service` and requires running this command `sudo ln -s /lib/systemd/system/home-assistant.service /etc/systemd/system/home-assistant.service` after file is created.
26
+
+ If unfamiliar with command line text editors, `sudo nano -w [filename]` can be used with `[filename]` replaced with the full path to the file. Ex. `sudo nano -w /etc/systemd/system/home-assistant@homeassistant.service`. After text entered, press CTRL-X then press Y to save and exit.
33
27
34
-
[Install]
35
-
WantedBy=multi-user.target
36
-
EOF'
37
28
```
38
-
39
-
For Ubunt 16.04 use this commands. Notice that files are saved in a slightly diffrent path
40
-
41
-
```bash
42
-
$ su -c 'cat <<EOF >> /lib/systemd/system/home-assistant.service
If you've setup Home Assistant in `virtualenv` following our [python installation guide](https://home-assistant.io/getting-started/installation-virtualenv/) or [manual installation guide for raspberry pi](https://home-assistant.io/getting-started/installation-raspberry-pi/), the following template should work for you.
42
+
If you've setup Home Assistant in `virtualenv` following our [python installation guide](https://home-assistant.io/getting-started/installation-virtualenv/) or [manual installation guide for raspberry pi](https://home-assistant.io/getting-started/installation-raspberry-pi/), the following template should work for you. If Home Assistant install is not located at `/srv/homeassistant`, please modify the `Enviroment=` and `ExecStart=` lines appropriately.
If everything went well, `sudo systemctl start home-assistant@[your user]` should give you a positive feedback.
103
+
You can also substitute the `start` above with `stop` to stop Home Assistant, `restart` to restart Home Assistant, and 'status' to see a brief status report as seen below.
106
104
107
105
```bash
108
-
$ sudo systemctl status home-assistant@[your user] -l
106
+
$ sudo systemctl status home-assistant@[your user]
109
107
● home-assistant@fab.service - Home Assistant for [your user]
0 commit comments