X-Git-Url: https://git.ralfj.de/osspd.git/blobdiff_plain/ca40ad12786733a136f5e932c80e8f428f6c7db8..1f6c7bec13c5d28d92465fc2628f2af38366ab9e:/debian/osspd.init?ds=sidebyside diff --git a/debian/osspd.init b/debian/osspd.init index 4b60b8e..8669c76 100644 --- a/debian/osspd.init +++ b/debian/osspd.init @@ -14,24 +14,17 @@ # Author: Ralf Jung PATH=/sbin:/usr/sbin:/bin:/usr/bin -DESC=" OSS Proxy Daemon" +DESC="OSS Proxy Daemon" NAME=osspd DAEMON=/usr/sbin/$NAME +DAEMON_ARGS="--dsp-slave=/usr/lib/osspd/ossp-slave" PIDFILE=/var/run/$NAME.pid SCRIPTNAME=/etc/init.d/$NAME # Exit if the package is not installed [ -x "$DAEMON" ] || exit 0 -# Read configuration variable file if it is present -[ -r /etc/default/$NAME ] && . /etc/default/$NAME - -# Load the VERBOSE setting and other rcS variables -. /lib/init/vars.sh - # Define LSB log_* functions. -# Depend on lsb-base (>= 3.2-14) to ensure that this file is present -# and status_of_proc is working. . /lib/lsb/init-functions # @@ -39,14 +32,15 @@ SCRIPTNAME=/etc/init.d/$NAME # do_start() { - modprobe cuse # make sure the cuse module is loaded # Return # 0 if daemon has been started # 1 if daemon was already running # 2 if daemon could not be started - start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON --test > /dev/null \ + start-stop-daemon --start --background --quiet --pidfile $PIDFILE --make-pidfile --exec $DAEMON --test > /dev/null \ || return 1 - start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON -- \ + # -f: run in foreground, start-stop-daemon does the forking - this is required to let start-stop-daemon handle the pidfile + start-stop-daemon --start --background --quiet --pidfile $PIDFILE --make-pidfile --exec $DAEMON -- -f \ + $DAEMON_ARGS \ || return 2 } @@ -66,19 +60,19 @@ do_stop() case "$1" in start) - [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME" + log_daemon_msg "Starting $DESC" "$NAME" do_start case "$?" in - 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; - 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; + 0|1) log_end_msg 0 ;; + 2) log_end_msg 1 ;; esac ;; stop) - [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME" + log_daemon_msg "Stopping $DESC" "$NAME" do_stop case "$?" in - 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; - 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; + 0|1) log_end_msg 0 ;; + 2) log_end_msg 1 ;; esac ;; status)