Package: supervisor
Version: 3.1.3-1
Severity: normal
Step to reproduce:
simulate a process with long termination time by using the STOP signal
on pause. It will get terminated anyway by the timeout.
# cat > /etc/supervisor/conf.d/long-stop-time.conf << 'EOF'
[program:long-stop-time]
stopsignal=STOP
command = sleep 10
EOF
Now try to start supervisord and restart it before the sleep timeout occurs
root@redacted:~# systemctl start supervisor
root@redacted:~# systemctl status supervisor
● supervisor.service - LSB: Start/stop supervisor
Loaded: loaded (/etc/init.d/supervisor)
Active: active (running) since Tue 2015-11-24 01:00:05 CET; 2s ago
Docs: man:systemd-sysv-generator(8)
Process: 20597 ExecStop=/etc/init.d/supervisor stop (code=exited,
status=0/SUCCESS)
Process: 20614 ExecStart=/etc/init.d/supervisor start (code=exited,
status=0/SUCCESS)
CGroup: /system.slice/supervisor.service
├─20619 /usr/bin/python /usr/bin/supervisord -c
/etc/supervisor/supervisord.conf
└─20622 sleep 10
Nov 24 01:00:04 redacted systemd[1]: Starting LSB: Start/stop supervisor...
Nov 24 01:00:05 redacted supervisor[20614]: Starting supervisor: supervisord.
Nov 24 01:00:05 redacted systemd[1]: Started LSB: Start/stop supervisor.
root@redacted:~# systemctl restart supervisor
Job for supervisor.service failed because the control process exited with error
code. See "systemctl status supervisor.service" and "journalctl -xe" for
details.
root@redacted:~# systemctl status supervisor
● supervisor.service - LSB: Start/stop supervisor
Loaded: loaded (/etc/init.d/supervisor)
Active: failed (Result: exit-code) since Tue 2015-11-24 01:00:11 CET; 2s ago
Docs: man:systemd-sysv-generator(8)
Process: 20631 ExecStop=/etc/init.d/supervisor stop (code=exited,
status=0/SUCCESS)
Process: 20634 ExecStart=/etc/init.d/supervisor start (code=exited,
status=1/FAILURE)
CGroup: /system.slice/supervisor.service
├─20619 /usr/bin/python /usr/bin/supervisord -c
/etc/supervisor/supervisord.conf
└─20622 sleep 10
Nov 24 01:00:11 redacted systemd[1]: Starting LSB: Start/stop supervisor...
Nov 24 01:00:11 redacted supervisor[20634]: Starting supervisor:
Nov 24 01:00:11 redacted systemd[1]: supervisor.service: Control process
exited, code=exited status=1
Nov 24 01:00:11 redacted systemd[1]: Failed to start LSB: Start/stop supervisor.
Nov 24 01:00:11 redacted systemd[1]: supervisor.service: Unit entered failed
state.
Nov 24 01:00:11 redacted systemd[1]: supervisor.service: Failed with result
'exit-code'.
I think that on restart, the init script should not try to start the
daemon until the old running instance has been really terminated.
Probably the stop command should be implemented using a strategy
similar to the one used in the force-stop command.
Ciao,
Marco
-- System Information:
Debian Release: stretch/sid
APT prefers unstable
APT policy: (500, 'unstable')
Architecture: amd64 (x86_64)
Kernel: Linux 4.2.0-1-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
Versions of packages supervisor depends on:
ii python-meld3 1.0.2-2
pn python:any <none>
supervisor recommends no packages.
Versions of packages supervisor suggests:
pn supervisor-doc <none>
-- no debconf information