From 3512b476b479e769d543112fa4e78728a09c9e9d Mon Sep 17 00:00:00 2001 From: cgtobi Date: Sat, 18 Mar 2017 22:08:17 +0100 Subject: [PATCH] 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 --- source/_docs/autostart/systemd.markdown | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/source/_docs/autostart/systemd.markdown b/source/_docs/autostart/systemd.markdown index 9dbcdae75e5..086e46eef09 100644 --- a/source/_docs/autostart/systemd.markdown +++ b/source/_docs/autostart/systemd.markdown @@ -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]