5 # Required-Start: $syslog $network $local_fs userv
6 # Required-Stop: $syslog $network $local_fs
7 # Default-Start: 2 3 4 5
9 # Short-Description: hippotatd
10 # Description: Asinine IP over HTTP server
13 DAEMON=/usr/sbin/hippotatd
14 MAIN_CONFIG=/etc/hippotat/main.cfg
16 PIDFILE=/var/run/hippotat/hippotatd.pid
21 DESCRIPTION='Asinine IP over HTTP server'
22 if type authbind >/dev/null 2>&1; then AUTHBIND=authbind; fi
24 test -e /etc/default/hippotatd && . /etc/default/hippotatd
28 test -f $DAEMON || exit 0
29 egrep '^[^ #]' $MAIN_CONFIG >/dev/null 2>&1 || exit 0
31 . /lib/lsb/init-functions
42 start-stop-daemon --quiet --user $USER --pidfile=$PIDFILE "$@"
47 pidfiledir=${PIDFILE%/*}
48 if test -d ${pidfiledir}; then return; fi
49 mkdir -m 755 $pidfiledir
50 chown $USER $pidfiledir
58 $AS_USER $DAEMON $HIPPOTATD_ARGS --print-config "$1"
62 vnetwork=$(print_config vnetwork)
63 if dump_firewall | fgrep " $vnetwork " >/dev/null; then :; else
65 "no entry in firewall for insecure vnetwork $vnetwork"
73 ssd --chuid $USER --start \
74 --startas /bin/sh -- -ec '"$@"' x \
75 $AUTHBIND $DAEMON --daemon --pidfile=$PIDFILE \
76 --syslog-facility=$LOGFACILITY $HIPPOTATD_ARGS
79 ssd --stop --oknodo --retry 5
84 log_daemon_msg "Starting $DESCRIPTION" hippotatd
91 log_daemon_msg "Stopping $DESCRIPTION" hippotatd
98 log_daemon_msg "Restarting $DESCRIPTION" hippotatd
106 log_failure_msg "Cannot reload hippotat - need restart"
111 echo >&2 "$0: unknown action $1"