sysv init : minor changes

This commit is contained in:
bolvan 2019-05-09 09:59:52 +03:00
parent 198225bc4f
commit 7d59377009

View File

@ -117,6 +117,7 @@ run_daemon()
echo $PID >$PIDFILE echo $PID >$PIDFILE
else else
echo could not start daemon $1 : $2 $3 echo could not start daemon $1 : $2 $3
false
fi fi
fi fi
fi fi
@ -130,7 +131,7 @@ stop_daemon()
local PIDFILE=$PIDDIR/$DAEMONBASE$1.pid local PIDFILE=$PIDDIR/$DAEMONBASE$1.pid
echo "Stopping daemon $1: $2" echo "Stopping daemon $1: $2"
if exists start-stop-daemon ; then if exists start-stop-daemon ; then
start-stop-daemon --stop --pidfile "$PIDFILE" --exec "$2" || true start-stop-daemon --stop --pidfile "$PIDFILE" --exec "$2"
else else
if [ -f "$PIDFILE" ]; then if [ -f "$PIDFILE" ]; then
read PID <"$PIDFILE" read PID <"$PIDFILE"
@ -138,7 +139,6 @@ stop_daemon()
rm -f "$PIDFILE" rm -f "$PIDFILE"
else else
echo no pidfile : $PIDFILE echo no pidfile : $PIDFILE
false
fi fi
fi fi
} }