Package: ps-watcher
Version: 1.06-6
Severity: important
Tags: patch

Hi, 

ps-watcher does not create a pidfile on its own, and start-stop-daemon 
does not (by default) do so either. Because there is no pidfile, the 
initscript stop command does not function.

Here is a patch that creates the pidfile. I first tried using the 
--make-pidfile option of start-stop-daemon, but this does not work as 
ps-watcher forks.

--- ps-watcher.orig     2008-09-30 17:28:34.000000000 -0400
+++ /etc/init.d/ps-watcher      2008-09-30 18:40:24.000000000 -0400
@@ -20,6 +20,7 @@
 DAEMON=/usr/bin/ps-watcher
 NAME=ps-watcher
 DESC=ps-watcher
+PIDFILE=/var/run/$NAME.pid

 test -x $DAEMON || exit 0

@@ -59,23 +60,25 @@
 case "$1" in
   start)
        echo -n "Starting $DESC: "
-       start-stop-daemon --start --quiet --pidfile /var/run/$NAME.pid \
+       start-stop-daemon --start --quiet \
                --exec $DAEMON -- -c $CONFIG --daemon $DAEMON_OPTS
+       /bin/ps -fe | grep $DAEMON | head -n1 | awk '{print $2}' > 
$PIDFILE
        echo "$NAME."
        ;;
   stop)
        echo -n "Stopping $DESC: "
-       start-stop-daemon --stop --quiet --pidfile /var/run/$NAME.pid \
-               --exec $DAEMON
+       start-stop-daemon --stop --quiet --pidfile $PIDFILE
+       rm -f $PIDFILE
        echo "$NAME."
        ;;
   restart|force-reload)
        echo -n "Restarting $DESC: "
-       start-stop-daemon --stop --quiet --pidfile /var/run/$NAME.pid \
-               --exec $DAEMON
+       start-stop-daemon --stop --quiet --pidfile $PIDFILE
+       rm -f $PIDFILE
        sleep 1
-       start-stop-daemon --start --quiet --pidfile /var/run/$NAME.pid \
-                --exec $DAEMON -- -c $CONFIG --daemon $DAEMON_OPTS
+       start-stop-daemon --start --quiet \
+               --exec $DAEMON -- -c $CONFIG --daemon $DAEMON_OPTS
+       /bin/ps -fe | grep $DAEMON | head -n1 | awk '{print $2}' > 
$PIDFILE
        echo "$NAME."
        ;;
   *)


-- System Information:
Debian Release: 4.0
  APT prefers proposed-updates
  APT policy: (500, 'proposed-updates'), (500, 'stable')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.24-etchnhalf.1-486
Locale: LANG=en_CA.utf8, LC_CTYPE=en_CA.utf8 (charmap=UTF-8)

Versions of packages ps-watcher depends on:
ii  libconfig-inifiles-perl     2.39-2       Read .ini-style configuration file
ii  perl                        5.8.8-7etch3 Larry Wall's Practical Extraction 

Versions of packages ps-watcher recommends:
ii  libsys-syslog-perl            0.18-1     Perl interface to the UNIX syslog(

-- no debconf information



-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to