5
# Required-Start: $remote_fs $syslog $network
6
# Required-Stop: $remote_fs $syslog $network
7
# Default-Start: 2 3 4 5
9
# Short-Description: OLA daemon
10
# Description: Open Lighting Architecture daemon
13
PATH=/usr/local/bin:/bin:/usr/bin
16
PIDFILE=/var/run/$NAME.pid
20
# Reads config file (will override defaults above)
21
[ -r /etc/default/ola ] && . /etc/default/ola
23
if [ "$RUN_DAEMON" = "true" ] || [ "$RUN_DAEMON" = "yes" ] ; then
24
DAEMON_ARGS="--syslog --log-level 3 --config-dir /etc/ola"
25
elif [ "$1" = "start" ] || [ "$1" = "stop" ] ; then
26
echo "The init script is currently inactive;\nuse \"dpkg-reconfigure ola\" to change this." >&2
29
[ -x "$DAEMON" ] || exit 0
31
. /lib/lsb/init-functions
36
if [ -n "$DAEMON_ARGS" ] ; then
37
log_daemon_msg "Starting $DESC" "$NAME"
38
/sbin/start-stop-daemon --start --background --make-pidfile --pidfile $PIDFILE --umask 0002 --chuid $USER --exec $DAEMON -- $DAEMON_ARGS
44
if [ "$RUN_DAEMON" = "true" ] || [ "$RUN_DAEMON" = "yes" ] ; then
45
log_daemon_msg "Stopping $DESC" "$NAME"
46
/sbin/start-stop-daemon --stop --pidfile $PIDFILE --chuid $USER --exec $DAEMON --retry 10
51
reload|force-reload|restart)
55
status_of_proc -p $PIDFILE $DAEMON $NAME && exit 0 || exit $?
58
echo "Usage: /etc/init.d/$NAME {start|stop|restart|status}" >&2