* try to watch the PID for shutting down citserver
authorWilfried Göesgens <willi@citadel.org>
Sun, 27 Jan 2008 00:07:06 +0000 (00:07 +0000)
committerWilfried Göesgens <willi@citadel.org>
Sun, 27 Jan 2008 00:07:06 +0000 (00:07 +0000)
citadel/debian/citadel.init

index 918695ac9b64183bacc3d4697dec1d1a3f74df55..6d27f03013ac4471c9ad7ad77096f92a5547d349 100644 (file)
@@ -73,17 +73,18 @@ do_stop()
        #   2 if daemon could not be stopped
        #   other if a failure occurred
         if $SENDCOMMAND "DOWN" >/dev/null 2>&1 ; then
+           PID=`cat $PIDFILE`
            rm -f $PIDFILE
            count=0;
-           while test -S /var/run/citadel/citadel.socket; do 
+           while test -S /var/run/citadel/citadel.socket -o -d /proc/$PID; do 
                count=$(($count+1))
                sleep 1
                echo -n "."
                if test "$count" = "10"; then
-                   killall citserver
+                   kill $PID
                fi
                if test "$count" = "20"; then
-                   killall -9 citserver
+                   kill -9 $PID
                    rm -rf /var/run/citadel/*
                fi
            done