Skip to content

Commit c1aeb7e

Browse files
asbachfabaff
authored andcommitted
Update systemd unit file for virtualenv (home-assistant#1785)
The current systemd unit file will provoke an error because the 'ExecPre' line calls a shell built-in function and all systemd Execs need to use an absolute path. the proposed change sets the python environment using the provided 'Environment' calls as used by systemd.
1 parent 7cd5ee3 commit c1aeb7e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

source/getting-started/autostart-systemd.markdown

+3-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,9 @@ After=network.target
4545
[Service]
4646
Type=simple
4747
User=homeassistant
48-
ExecStartPre=source /srv/homeassistant/homeassistant_venv/bin/activate
48+
#make sure the virtualenv python binary is used
49+
Environment=VIRTUAL_ENV="/srv/homeassistant/homeassistant_venv"
50+
Environment=PATH="$VIRTUAL_ENV/bin:$PATH"
4951
ExecStart=/srv/homeassistant/homeassistant_venv/bin/hass -c "/home/homeassistant/.homeassistant"
5052
5153
[Install]

0 commit comments

Comments
 (0)