Remove unnecessary environment variable setup from systemd service (#2223)

* Remove unnecessary environment variable setup 

The environment variables are not needed and are actually overriding the system PATH variable and were causing trouble in certain circumstances.

* Make the user for the service dynamic

* Cleans up leftover comment

* Refine text to reflect the changes in the service

* Revert change of the users home path
This commit is contained in:
cgtobi 2017-03-18 22:08:17 +01:00 committed by Fredrik Lindqvist
parent 889d8d6dfd
commit 3512b476b4

View File

@ -39,7 +39,7 @@ ExecStart=/usr/bin/hass
WantedBy=multi-user.target
```
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 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 `ExecStart=` line appropriately.
```
[Unit]
@ -48,10 +48,7 @@ After=network.target
[Service]
Type=simple
User=homeassistant
# Make sure the virtualenv Python binary is used
Environment=VIRTUAL_ENV="/srv/homeassistant"
Environment=PATH="$VIRTUAL_ENV/bin:$PATH"
User=%i
ExecStart=/srv/homeassistant/bin/hass -c "/home/homeassistant/.homeassistant"
[Install]