supervisor init script doesn't wait for supervisor to stop
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
supervisor (Ubuntu) |
Confirmed
|
Undecided
|
Unassigned |
Bug Description
Since the supervisor doesn't block while stopping the init script returns from the stop command before the process dies. The following patch fixes this:
diff --git a/debian/
index 334d4c6..49ed69b 100644
--- a/debian/
+++ b/debian/
@@ -100,10 +100,18 @@ case "$1" in
fi
;;
stop)
- echo -n "Stopping $DESC: "
- start-stop-daemon --stop --quiet --oknodo --pidfile $PIDFILE
- echo "$NAME."
- ;;
+ echo -n "Stopping $DESC: "
+ if [ -e $PIDFILE ]; then
+ pid=$(cat $PIDFILE)
+ fi
+ start-stop-daemon --stop --quiet --oknodo --pidfile $PIDFILE
+ if [ ! -z "$pid" ]; then
+ while [ -e /proc/$pid ]; do
+ sleep 1;
+ done
+ fi
+ echo "$NAME."
+ ;;
force-stop)
echo -n "Forcefully stopping $DESC: "
force_stop
description: | updated |
description: | updated |
Status changed to 'Confirmed' because the bug affects multiple users.