Updated hass service
This commit is contained in:
@@ -1,31 +1,14 @@
|
|||||||
#!/sbin/openrc-run
|
#!/sbin/openrc-run
|
||||||
CONFIG_DIR=/opt/HomeAssistant/data/
|
supervisor=supervise-daemon
|
||||||
USER=hass
|
name=hass
|
||||||
GROUP=hass
|
|
||||||
PIDFILE=/var/run/homeassistant/homeassistant.pid
|
|
||||||
|
|
||||||
CMD="/opt/HomeAssistant/srv/bin/hass"
|
command_user="hass"
|
||||||
ARGS="-c ${CONFIG_DIR} --pid-file ${PIDFILE}"
|
command="/opt/HomeAssistant/srv/bin/hass"
|
||||||
|
command_args="-c /opt/HomeAssistant/data/"
|
||||||
|
|
||||||
|
pidfile="/var/run/homeassistant/homeassistant.pid"
|
||||||
|
|
||||||
depend() {
|
depend() {
|
||||||
use dns
|
use logger dns
|
||||||
}
|
need net
|
||||||
|
}
|
||||||
start() {
|
|
||||||
mkdir -p /var/log/homeassistant
|
|
||||||
chown -R ${USER}.${GROUP} /var/log/homeassistant
|
|
||||||
mkdir -p /var/run/homeassistant
|
|
||||||
chown -R ${USER}.${GROUP} /var/run/homeassistant
|
|
||||||
ebegin "Starting ${SVCNAME}"
|
|
||||||
start-stop-daemon --pidfile $PIDFILE -u $USER -g $GROUP -b \
|
|
||||||
-1 /var/log/homeassistant/homeassistant.log \
|
|
||||||
-2 /var/log/homeassistant/homeassistant.log \
|
|
||||||
-x $CMD -- $ARGS
|
|
||||||
eend $?
|
|
||||||
}
|
|
||||||
|
|
||||||
stop() {
|
|
||||||
ebegin "Stopping ${SVCNAME}"
|
|
||||||
start-stop-daemon --pidfile $PIDFILE -u $USER -g $GROUP -x $CMD -K -q
|
|
||||||
eend $?
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user