diff --git a/debian/openxcap.init b/debian/openxcap.init index 5ab1b28..e6f4584 100644 --- a/debian/openxcap.init +++ b/debian/openxcap.init @@ -1,76 +1,69 @@ #!/bin/sh # ### BEGIN INIT INFO # Provides: openxcap # Required-Start: $syslog $network $local_fs $remote_fs $time # Required-Stop: $syslog $network $local_fs $remote_fs # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: Start the OpenXCAP server # Description: Start the OpenXCAP server ### END INIT INFO PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin INSTALL_DIR="/usr/bin" RUNTIME_DIR="/var/run/openxcap" DEFAULTS="/etc/default/openxcap" SERVER="$INSTALL_DIR/openxcap" PID="$RUNTIME_DIR/openxcap.pid" -# Options for the OpenXCAP server. Do not include --pid -# --pid will be added automatically if needed. -OPTIONS="" - NAME="openxcap" DESC="OpenXCAP server" test -f $SERVER || exit 0 -if [ "$PID" != "/var/run/openxcap/openxcap.pid" ]; then - OPTIONS="--pid $PID $OPTIONS" -fi +. /lib/lsb/init-functions # Load startup options if available if [ -f $DEFAULTS ]; then . $DEFAULTS || true fi if [ "$RUN_OPENXCAP" != "yes" ]; then echo "OpenXCAP not yet configured. Edit /etc/default/openxcap first." exit 0 fi start() { echo -n "Starting $DESC: $NAME " - start-stop-daemon --start --quiet --pidfile $PID --exec $SERVER -- $OPTIONS + start-stop-daemon --start --quiet --pidfile $PID --exec $SERVER echo "." } stop () { echo -n "Stopping $DESC: $NAME " - start-stop-daemon --stop --quiet --oknodo --signal 15 --pidfile $PID + start-stop-daemon --stop --quiet --oknodo --retry=TERM/15/KILL/5 --pidfile $PID echo "." } case "$1" in start) start ;; stop) stop ;; restart|force-reload) stop - #sleep 1 start ;; *) echo "Usage: /etc/init.d/$NAME {start|stop|restart|force-reload}" >&2 exit 1 ;; esac exit 0