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
Copy file name to clipboardExpand all lines: source/getting-started/autostart.markdown
+23-24
Original file line number
Diff line number
Diff line change
@@ -32,7 +32,6 @@ Upstart will launch init scripts that are located in the directory `/etc/init.d/
32
32
33
33
To install this script, download it, tweak it to you liking, and install it by following the directions in the header. This script will setup Home Assistant to run when the system boots. To start/stop Home Assistant manually, issue the following commands:
34
34
35
-
36
35
```bash
37
36
$ sudo service hass-daemon start
38
37
$ sudo service hass-daemon stop
@@ -44,64 +43,64 @@ When running daemons, it is good practice to have the daemon run under its own u
Newer linux distributions are trending towards using systemd for managing daemons. Typically, systems based on Fedora or Debian 8 or later use systemd. This includes Ubuntu releases including and after 15.04, CentOS, and Red Hat. If you are unsure if your system is using systemd, you may check with the following command:
48
-
46
+
Newer linux distributions are trending towards using systemd for managing daemons. Typically, systems based on Fedora or Debian 8 or later use systemd. This includes Ubuntu releases including and after 15.04, CentOS, and Red Hat. If you are unsure if your system is using `systemd`, you may check with the following command:
49
47
50
48
```bash
51
49
$ ps -p 1 -o comm=
52
50
```
53
51
54
-
If the preceding command returns the string `systemd`, you are likely using systemd.
55
-
56
-
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.
52
+
If the preceding command returns the string `systemd`, you are likely using `systemd`.
57
53
54
+
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 then replace the `[your user]` with `pi` otherwise use your user you want to run Home Assistant.
58
55
59
56
```bash
60
-
$ su -c 'cat <<EOF >> /lib/systemd/system/home-assistant.service
57
+
$ su -c 'cat <<EOF >> /lib/systemd/system/home-assistant@[your user].service
61
58
[Unit]
62
59
Description=Home Assistant
63
60
After=network.target
64
61
65
62
[Service]
66
63
Type=simple
67
-
ExecStart=/usr/local/bin/hass
68
-
# Next line is to run as a specific user
69
-
# for Raspberry Pi users, keep it at 'pi'
70
-
User=pi
64
+
User=%i
65
+
ExecStart=/usr/bin/hass
71
66
72
67
[Install]
73
68
WantedBy=multi-user.target
74
69
EOF'
75
70
```
76
71
77
-
You need to reload systemd to make the daemon aware of the new configuration. Enable and launch Home Assistant after that.
72
+
There is also another [sample service file](https://raw.githubusercontent.com/balloob/home-assistant/master/script/home-assistant%40.service) available. To use this one, just download it.
0 commit comments