You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
39 lines
1.3 KiB
39 lines
1.3 KiB
9 years ago
|
#!upstart
|
||
|
description "ServiceDock"
|
||
|
author "Marc Wäckerlin"
|
||
|
|
||
|
start on (local-filesystems and net-device-up)
|
||
|
stop on runlevel [!2345]
|
||
|
|
||
|
respawn
|
||
|
|
||
|
script
|
||
|
echo $$ > /var/run/servicedock.pid
|
||
|
# there are some useful defaults
|
||
|
# do not edit this file, overwrite values in /etc/default/servicedock
|
||
|
EXEC_SERVICEDOCK="/usr/bin/nodejs /usr/share/servicedock/nodejs/servicedock"
|
||
|
SERVICEDOCK_LOG="/var/log/servicedock.log"
|
||
|
SERVICEDOCK_USER="servicedock"
|
||
|
SERVICEDOCK_PORT=""
|
||
|
[ -r /etc/default/servicedock ] && . /etc/default/servicedock
|
||
|
if test -n "${SERVICEDOCK_USER}"; then
|
||
|
exec sudo -u "${SERVICEDOCK_USER}" ${EXEC_SERVICEDOCK} ${SERVICEDOCK_PORT} >> ${SERVICEDOCK_LOG} 2>&1
|
||
|
else
|
||
|
exec ${NODEJS_BIN} >> ${SERVICEDOCK_LOG} 2>&1
|
||
|
fi
|
||
|
end script
|
||
|
|
||
|
pre-start script
|
||
|
SERVICEDOCK_LOG="/var/log/servicedock.log"
|
||
|
[ -r /etc/default/servicedock ] && . /etc/default/servicedock
|
||
|
# Date format same as (new Date()).toISOString() for consistency
|
||
|
echo "[`date -u +%Y-%m-%dT%T.%3NZ`] (sys) Starting" >> ${SERVICEDOCK_LOG}
|
||
|
end script
|
||
|
|
||
|
pre-stop script
|
||
|
SERVICEDOCK_LOG="/var/log/servicedock.log"
|
||
|
[ -r /etc/default/servicedock ] && . /etc/default/servicedock
|
||
|
rm /var/run/servicedock.pid
|
||
|
echo "[`date -u +%Y-%m-%dT%T.%3NZ`] (sys) Stopping" >> ${SERVICEDOCK_LOG}
|
||
|
end script
|