#877086 restart in init script only stops supervisor

#877086#5
Date:
2017-09-28 14:20:03 UTC
From:
To:
Package: supervisor
Version: 3.3.1-1+deb9u1

Hello,

the init script in supervisord package doesn't contain code for starting
supervisor, so in only stops supervisor, but doesn't start it after:

   restart)
     echo -n "Restarting $DESC: "
     start-stop-daemon --stop --retry=$RETRY --quiet --oknodo --pidfile $PIDFILE
         echo "$NAME."
         ;;


it apparently needs the code from "start" section.
(and probably reindent so it's consistent with rest of the script)

#877086#10
Date:
2017-11-20 19:36:54 UTC
From:
To:
We see a vary similar issue with supervisor 3.0r1-1+deb8u1 on Debian
8.9, even though the `restart` command seem to look alright (see
below).

Restarting the service fails (when the service is up beforehand),
because the Supervisor daemon seens to need some time to shut down.
Stopping and starting works fine, provided there passes some time
between their execution:

$ sudo service supervisor restart
Job for supervisor.service failed. See 'systemctl status
supervisor.service' and 'journalctl -xn' for details.
$ sudo service supervisor start
$ sudo service supervisor stop && sleep 1 && sudo service supervisor start


```
# FILE: /etc/init.d/supervisor
  restart)
    echo -n "Restarting $DESC: "
    start-stop-daemon --stop --quiet --oknodo --pidfile $PIDFILE
        [ -n "$DODTIME" ] && sleep $DODTIME
        start-stop-daemon --start --quiet --pidfile $PIDFILE \
                --startas $DAEMON -- $DAEMON_OPTS
        echo "$NAME."
        ;;
```

#877086#15
Date:
2017-11-21 17:34:48 UTC
From:
To:
(Sorry for the typos. Shame on me!) -- To follow up on my earlier comment:

Interestingly, the $DODTIME value is already defined in the startup
script. Nevertheless the "sleep 5" command doesn't seem to be executed
as we would expect, to avoid restarting to fail:

```
# FILE:  /etc/init.d/supervisor, lines 35+
DODTIME=5                   # Time to wait for the server to die, in seconds
                            # If this value is set too low you might not
                            # let some servers to die gracefully and
                            # 'restart' will not work
```

For some reason this fails.

#877086#20
Date:
2025-11-19 10:37:41 UTC
From:
To:
Dear Maintainer,

   * What led up to the situation?

Attempting to restart the Supervisor service using the SysV init script (/etc/init.d/supervisor restart) on Debian Bookworm, as part of routine maintenance (eg : Docker context).

   * What exactly did you do (or not do) that was effective (or
     ineffective)?

Executed /etc/init.d/supervisor restart, which stopped the daemon but failed to restart it due to missing start invocation in the restart() function.

   * What was the outcome of this action?

Supervisor daemon stopped (no process via ps aux | grep supervisord), leaving managed processes down until manual start.

   * What outcome did you expect instead?

Daemon to stop gracefully and then restart automatically, restoring all managed processes.


The restart() function in debian/supervisor.init only stops the service via start-stop-daemon --stop but lacks a subsequent start call, leaving it stopped. This is a known longstanding issue (bug #877086).
Attached is a DEP-3 formatted patch (v5) that:

Changes the echo message to "Stopping $DESC: " for clarity.
Inserts $0 start after the post-stop echo, with exact tab indentation matching the original.

Tested on Debian Bookworm: After applying and rebuilding/installing the .deb, restart now stops, echoes "supervisor.", then calls start() successfully.
Please apply this patch and close #877086.

Thanks.