From ecf53028d795b48e17c8e481f2a7be662e02c74a Mon Sep 17 00:00:00 2001 From: ryqiem Date: Sun, 23 Oct 2016 10:53:19 +0200 Subject: [PATCH] Added virtualenv example --- .../getting-started/autostart-systemd.markdown | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/source/getting-started/autostart-systemd.markdown b/source/getting-started/autostart-systemd.markdown index f3e90be5959..f18987a26bd 100644 --- a/source/getting-started/autostart-systemd.markdown +++ b/source/getting-started/autostart-systemd.markdown @@ -35,6 +35,23 @@ WantedBy=multi-user.target EOF' ``` +If you've setup `hass` in virtualenv following the guide the following template should work for you. + +``` +[Unit] +Description=Home Assistant +After=network.target + +[Service] +Type=simple +User=hass +ExecStartPre=source source /srv/hass/bin/activate +ExecStart=/srv/hass/bin/hass -c "/home/hass/.homeassistant" + +[Install] +WantedBy=multi-user.target +``` + There is also another [sample service file](https://raw.githubusercontent.com/home-assistant/home-assistant/master/script/home-assistant%40.service) available. To use this one, just download it. ```bash