[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#4093: start-stop-daemon fails to kill process



Maybe should it kill the process whose pid is in the pidfile, even if
it does not think the executable is running?

Here is an example of the problem:

marin66# /etc/init.d/apache stop
no /usr/sbin/apache found; none killed.
marin67# cat /var/run/apache/apache.pid 
12707
marin68# ps -ax|grep 12707
12707  ?  S    0:00 /usr/sbin/apache 
20378  p9 S    0:00 grep 12707 

And /etc/init.d/apache is:

#! /bin/sh
#
# apache	Start the apache HTTP server.
#
#
PATH=/bin:/usr/bin:/sbin:/usr/sbin
DAEMON=/usr/sbin/apache
NAME=apache

test -f $DAEMON || exit 0

if [ -d /var/run/apache ]
then
    PIDFILE=/var/run/apache/$NAME.pid
else
    PIDFILE=/var/run/$NAME.pid
fi

case "$1" in
  start)
    start-stop-daemon --start --verbose --pidfile $PIDFILE --exec $DAEMON
    ;;
  stop)
    start-stop-daemon --stop --verbose --pidfile $PIDFILE --exec $DAEMON
    ;;
  reload)
    echo "Reloading $NAME configuration files"
    start-stop-daemon --stop --signal 1 --quiet --pidfile $PIDFILE \
	--exec $DAEMON
    ;;
  *)
    echo "Usage: /etc/init.d/$NAME {start|stop|reload}"
    exit 1
    ;;
esac

exit 0

-- 



Reply to: