chiark / gitweb /
packaging fixes
[hippotat] / debian / hippotat.hippotatd.init
index 640bd8f26a24a795fccab59c3c048f4557facb83..fbee31fa79ee1a8f4bb78f976ee5751b2ae4c5cc 100644 (file)
@@ -10,7 +10,7 @@
 # Description:          Asinine IP over HTTP server
 ### END INIT INFO
 
-DAEMON=/usr/sbin/hippotat
+DAEMON=/usr/sbin/hippotatd
 MASTER_CONFIG=/etc/hippotat/master.cfg
 USER=Debian-hippotat
 PIDFILE=/var/run/hippotat/hippotatd.pid
@@ -21,8 +21,11 @@ AS_USER=as_user_userv
 DESCRIPTION='Asinine IP over HTTP server'
 if type -p authbind >/dev/null 2>&1; then AUTHBIND=authbind; fi
 
+test -e /etc/default/hippotatd &&
 . /etc/default/hippotatd
 
+set -e
+
 test -f $DAEMON || exit 0
 egrep '^[^     #]' $MASTER_CONFIG >/dev/null 2>&1 || exit 0
 
@@ -37,7 +40,7 @@ as_user_userv () {
 
 ssd () {
        set +e
-       start-stop-daemon --start --quiet --user $USER --pidfile=$PIDFILE "$@"
+       start-stop-daemon --quiet --user $USER --pidfile=$PIDFILE "$@"
        rc=$?
        set -e
 }
@@ -68,12 +71,12 @@ check_firewall () {
 do_start () {
        check_firewall
        ensure_dirs
-       ssd     --chuid $USER --startas                         \
+       ssd     --chuid $USER --start --startas                 \
                $AUTHBIND $DAEMON --daemon --pidfile=$PIDFILE   \
                --syslog-facility=$LOGFACILITY $HIPPOTATD_ARGS
 }
 do_stop () {
-       ssd     --stop --retry 5
+       ssd     --stop --oknodo --retry 5
 }
 
 case "$1" in