drop killall and ugly pidfile creation

This commit is contained in:
Jan Wagner 2007-07-04 19:47:44 +00:00
parent 22ab12dd8b
commit a194005d4b

13
debian/init.d vendored
View file

@ -35,23 +35,22 @@ case "$1" in
echo -n "Starting $DESC: " echo -n "Starting $DESC: "
start-stop-daemon --start --quiet --pidfile /var/run/$NAME.pid \ start-stop-daemon --start --quiet --pidfile /var/run/$NAME.pid \
--exec $DAEMON -- $DAEMON_OPTS --exec $DAEMON -- $DAEMON_OPTS
ps aux | grep $DAEMON | head -1 | awk '{ print $2 }' > /var/run/$NAME.pid
echo "$NAME." echo "$NAME."
;; ;;
stop) stop)
echo -n "Stopping $DESC: " echo -n "Stopping $DESC: "
start-stop-daemon --stop --quiet --pidfile /var/run/$NAME.pid \ start-stop-daemon --stop --quiet --pidfile /var/run/$NAME.pid \
--exec $DAEMON --exec $DAEMON
killall -9 $NAME
echo "$NAME." echo "$NAME."
;; ;;
restart|force-reload) restart|force-reload)
echo -n "Restarting $DESC: " echo -n "Restarting $DESC: "
start-stop-daemon --stop --quiet --pidfile \ start-stop-daemon --stop --quiet --pidfile /var/run/$NAME.pid \
/var/run/$NAME.pid --exec $DAEMON --exec $DAEMON
killall -9 $NAME start-stop-daemon --start --quiet --pidfile /var/run/$NAME.pid \
sleep 1 --exec $DAEMON -- $DAEMON_OPTS
start-stop-daemon --start --quiet --pidfile \ ps aux | grep $DAEMON | head -1 | awk '{ print $2 }' > /var/run/$NAME.pid
/var/run/$NAME.pid --exec $DAEMON -- $DAEMON_OPTS
echo "$NAME." echo "$NAME."
;; ;;
*) *)