Restart option in supervisor init script does not work
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
supervisor (Debian) |
Fix Released
|
Unknown
|
|||
supervisor (Ubuntu) |
Fix Released
|
Medium
|
Unassigned |
Bug Description
Supervisord does not restart when invoked via `# /etc/init.
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://
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-
Depends: python-support (>= 0.90.0)
(...)
Changed in supervisor (Ubuntu): | |
status: | New → Triaged |
importance: | Undecided → Medium |
Changed in supervisor (Debian): | |
status: | Unknown → New |
Changed in supervisor (Debian): | |
status: | New → Fix Released |
The attachment "Patch for the /etc/init. d/supervisor script" seems to be a patch. If it isn't, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are a member of the ~ubuntu-reviewers, unsubscribe the team.
[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issues please contact him.]