Update systemd unit file for virtualenv (#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.
This commit is contained in:
parent
7cd5ee3112
commit
c1aeb7ed55
1 changed files with 3 additions and 1 deletions
|
@ -45,7 +45,9 @@ After=network.target
|
||||||
[Service]
|
[Service]
|
||||||
Type=simple
|
Type=simple
|
||||||
User=homeassistant
|
User=homeassistant
|
||||||
ExecStartPre=source /srv/homeassistant/homeassistant_venv/bin/activate
|
#make sure the virtualenv python binary is used
|
||||||
|
Environment=VIRTUAL_ENV="/srv/homeassistant/homeassistant_venv"
|
||||||
|
Environment=PATH="$VIRTUAL_ENV/bin:$PATH"
|
||||||
ExecStart=/srv/homeassistant/homeassistant_venv/bin/hass -c "/home/homeassistant/.homeassistant"
|
ExecStart=/srv/homeassistant/homeassistant_venv/bin/hass -c "/home/homeassistant/.homeassistant"
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue