[Bug 1163753] [NEW] Restart option in supervisor init script does not work

Launchpad Bug Tracker 1163753 at bugs.launchpad.net
Mon Jul 29 16:08:51 UTC 2013


You have been subscribed to a public bug by fqj1994 (fqj1994):

Supervisord does not restart when invoked via `# /etc/init.d/supervisor
restart` or `# service supervisor restart`

Its PID stays the same.  Manually stopping, then starting the package
works, but management tools  break if they  depend on `restart` working.

This is a documented bug from Debian, where the package originates and there is a patch available, although maintainer seems to be MIA:
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=609457

I copy from the Debian bug report:

> The start-stop-daemon does not find running instances
and so some conditionals in the script don't work.

> Another side-effect is that the pidfile gets removed
when invoking the script with "start" and supervisord is already running.

I have applied the patch from the Debian bug report, and it works.
Here's my own patch after applying and testing:

diff --git a/supervisor b/supervisor
index 334d4c6..05f28e1 100755
--- a/supervisor
+++ b/supervisor
@@ -91,7 +91,7 @@ case "$1" in
   start)
 	echo -n "Starting $DESC: "
 	start-stop-daemon --start --quiet --pidfile $PIDFILE \
-		--exec $DAEMON -- $DAEMON_OPTS
+		--startas $DAEMON -- $DAEMON_OPTS
 	test -f $PIDFILE || sleep 1
         if running ; then
             echo "$NAME."
@@ -132,18 +132,17 @@ case "$1" in
 	#	just the same as "restart" except that it does nothing if the
 	#   daemon isn't already running.
 	# check wether $DAEMON is running. If so, restart
-	start-stop-daemon --stop --test --quiet --pidfile \
-		/var/run/$NAME.pid --exec $DAEMON \
+	start-stop-daemon --stop --test --quiet --pidfile $PIDFILE\
+		--startas $DAEMON \
 	&& $0 restart \
 	|| exit 0
 	;;
   restart)
     echo -n "Restarting $DESC: "
-	start-stop-daemon --stop --quiet --pidfile \
-		/var/run/$NAME.pid --exec $DAEMON
+	start-stop-daemon --stop --quiet --oknodo --pidfile $PIDFILE
 	[ -n "$DODTIME" ] && sleep $DODTIME
-	start-stop-daemon --start --quiet --pidfile \
-		/var/run/$NAME.pid --exec $DAEMON -- $DAEMON_OPTS
+	start-stop-daemon --start --quiet --pidfile $PIDFILE\
+		--startas $DAEMON -- $DAEMON_OPTS
 	echo "$NAME."
 	;;
   status)

More data:

$ lsb_release -rd
Description:	Ubuntu 12.04.2 LTS
Release:	12.04

$ apt-cache policy supervisor
supervisor:
  Installed: 3.0a8-1.1
  Candidate: 3.0a8-1.1

$ apt-rdepends supervisor
(...)
supervisor
  Depends: python (>= 2.3)
  Depends: python-medusa (>= 0.5.4)
  Depends: python-meld3
  Depends: python-pkg-resources (>= 0.6c7)
  Depends: python-support (>= 0.90.0)
(...)

** Affects: supervisor (Ubuntu)
     Importance: Medium
         Status: Triaged

** Affects: supervisor (Debian)
     Importance: Unknown
         Status: Fix Released


** Tags: 12.04 lts patch precise
-- 
Restart option in supervisor init script does not work
https://bugs.launchpad.net/bugs/1163753
You received this bug notification because you are a member of Ubuntu Sponsors Team, which is subscribed to the bug report.



More information about the Ubuntu-sponsors mailing list