make and remove pidfile

This commit is contained in:
Clint Armstrong 2015-07-23 15:09:06 -04:00
parent 29a6f1b057
commit 985ea21f6e

View File

@ -36,7 +36,7 @@ case $1 in
log_daemon_msg "Starting the process" "$NAME"
# Start the daemon with the help of start-stop-daemon
# Log the message appropriately
if start-stop-daemon --start --quiet --oknodo --pidfile $PIDFILE --exec $DAEMON --chuid $USER --background; then
if start-stop-daemon --start --quiet --oknodo --make-pidfile --pidfile $PIDFILE --exec $DAEMON --chuid $USER --background; then
log_end_msg 0
else
log_end_msg 1
@ -48,7 +48,7 @@ case $1 in
if [ -e $PIDFILE ]; then
status_of_proc -p $PIDFILE $DAEMON "Stoppping the $NAME process" && status="0" || status="$?"
if [ "$status" = 0 ]; then
start-stop-daemon --stop --quiet --oknodo --pidfile $PIDFILE
start-stop-daemon --stop --quiet --oknodo --remove-pidfile --pidfile $PIDFILE
/bin/rm -rf $PIDFILE
fi
else