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

From: Yves Arrouye <[email-masked]>
Date: Sat, 10 Aug 1996 01:22:51 +0200

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

--

---

From: Ian Jackson <[email-masked]>
Date: Sat, 10 Aug 96 17:58 BST

> 20378  p9 S    0:00 grep 12707 

Are you using a new apache package ?  On my system apache installs
itself as /usr/sbin/apache-httpd.

In any case, could you check to see what
 ls -ali /proc/12707/exe
 ls -aliL /proc/12707/exe
shows and what
 ls -ali /usr/sbin/apache
shows ?

Thanks,
Ian.