From 071952462c0116ec8b7b84db7f6616e73379c928 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Thu, 3 Sep 2015 22:06:50 +0200 Subject: [PATCH 1/4] initial systemd service unit file --- scripts/home-assistant.service | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 scripts/home-assistant.service diff --git a/scripts/home-assistant.service b/scripts/home-assistant.service new file mode 100644 index 00000000000..6f0f767cddf --- /dev/null +++ b/scripts/home-assistant.service @@ -0,0 +1,13 @@ +# This is a simple service file for systems with systemd. +# +[Unit] +Description=Home Assistant +After=network.target + +[Service] +Type=simple +ExecStart=/usr/bin/hass --config /root/.homeassistant + +[Install] +WantedBy=multi-user.target + From d7464aea8620ebe0930e753a7cec5541deb39302 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Thu, 3 Sep 2015 22:06:50 +0200 Subject: [PATCH 2/4] Initial systemd service unit file From 9ce8f385d2ad36534e6e29b6188441992f9c82cd Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Fri, 18 Sep 2015 14:15:42 +0200 Subject: [PATCH 3/4] Rename service unit file --- scripts/home-assistant.service => script/home-assistant@.service | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename scripts/home-assistant.service => script/home-assistant@.service (100%) diff --git a/scripts/home-assistant.service b/script/home-assistant@.service similarity index 100% rename from scripts/home-assistant.service rename to script/home-assistant@.service From 5ce4ade737459351d7697a6f589f7da5ccbf0609 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Fri, 18 Sep 2015 14:18:49 +0200 Subject: [PATCH 4/4] Add user and change config dir --- script/home-assistant@.service | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/script/home-assistant@.service b/script/home-assistant@.service index 6f0f767cddf..983844a95a3 100644 --- a/script/home-assistant@.service +++ b/script/home-assistant@.service @@ -1,13 +1,14 @@ -# This is a simple service file for systems with systemd. +# This is a simple service file for systems with systemd to tun HA as user. # [Unit] -Description=Home Assistant +Description=Home Assistant for %i After=network.target [Service] Type=simple -ExecStart=/usr/bin/hass --config /root/.homeassistant +User=%i +WorkingDirectory=%h +ExecStart=/usr/bin/hass --config %h/.homeassistant/ [Install] WantedBy=multi-user.target -