From: achbed Date: Fri, 12 Dec 2014 22:28:53 +0000 (-0600) Subject: Updated init.d scripts for cleaner stop/start X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=abcc3cd33f1827812f9c98bf59086681f636b01a;p=deefuzzer.git Updated init.d scripts for cleaner stop/start Signed-off-by: achbed --- diff --git a/scripts/etc/default/deefuzzer b/scripts/etc/default/deefuzzer index 4b0a59d..437acf4 100644 --- a/scripts/etc/default/deefuzzer +++ b/scripts/etc/default/deefuzzer @@ -7,7 +7,10 @@ # # Full path to the server configuration file -CONFIGFILE="/srv/pt/patestapes.com/deefuzzer.xml" +CONFIGFILE="/etc/deefuzzer/deefuzzer.xml" + +# Full path to the process ID file +PIDFILE="/var/log/deefuzzer/deefuzzer.pid" # Name or ID of the user and group the daemon should run under USERID=deefuzzer diff --git a/scripts/etc/init.d/deefuzzer b/scripts/etc/init.d/deefuzzer index 703b89a..03053ea 100644 --- a/scripts/etc/init.d/deefuzzer +++ b/scripts/etc/init.d/deefuzzer @@ -11,7 +11,8 @@ # deefuzzer # # Written By Dennis Wallace (github@achbed.org) -# Based on code by Miquel van Smoorenburg . +# Based on icecast2 by Miquel van Smoorenburg +. # Modified for Debian # by Ian Murdock . # @@ -32,9 +33,10 @@ test -x $DAEMON || exit 0 CONFIGFILE="/etc/deefuzzer/deefuzzer.xml" CONFIGDEFAULTFILE="/etc/default/deefuzzer" USERID=deefuzzer -GROUPID=staff +GROUPID=deefuzzer ENABLE="false" QUIET="--quiet" +PIDFILE=/"var/log/deefuzzer/deefuzzer.pid" # Reads config file (will override defaults above) [ -r "$CONFIGDEFAULTFILE" ] && . $CONFIGDEFAULTFILE @@ -49,20 +51,22 @@ set -e case "$1" in start) echo -n "Starting $DESC: " - $DAEMON $CONFIGFILE & + start-stop-daemon --start --background -m --oknodo --pidfile ${PIDFILE} +--exec ${DAEMON} -- ${CONFIGFILE} echo "$NAME." ;; stop) echo -n "Stopping $DESC: " - # Send TERM after 5 seconds, wait at most 30 seconds. - killall $NAME + start-stop-daemon --stop --oknodo --pidfile ${PIDFILE} + rm -f ${PIDFILE} echo "$NAME." ;; reload|force-reload|restart) echo -n "Restarting $DESC: " - # Send TERM after 5 seconds, wait at most 30 seconds. - killall deefuzzer - $DAEMON $CONFIGFILE & + start-stop-daemon --stop --oknodo --pidfile ${PIDFILE} + rm -f ${PIDFILE} + start-stop-daemon --start --background -m --oknodo --pidfile ${PIDFILE} +--exec ${DAEMON} -- ${CONFIGFILE} echo "$NAME." ;; *)