Skip to content

Instantly share code, notes, and snippets.

@dalyons
Created January 27, 2016 17:53
Show Gist options
  • Save dalyons/85148091fdeca06ac9bf to your computer and use it in GitHub Desktop.
Save dalyons/85148091fdeca06ac9bf to your computer and use it in GitHub Desktop.
jonathantullett commented on Feb 9, 2015
I have discovered an issue whereby starting a process via by doing
supervisor> start procgroup:*
does not honour the autorestart settings and results in supervisor trying to restart any failed processes in that group indefinitely.
My test-case config file:
[program:test]
command=/tmp/exit-non-zero.sh
autostart=false
autorestart=false
startsecs=3
[group:mytest]
programs=test
/tmp/exit-non-zero.sh contains:
#!/bin/bash
sleep 1
exit 1
Then I run the test:
supervisor> start mytest:test
mytest:test: ERROR (abnormal termination)
supervisor> start mytest:*
At this point it keeps respawning. The logs contain:
2015-02-09 11:32:53,037 INFO spawned: 'test' with pid 11913
2015-02-09 11:32:54,060 INFO exited: test (exit status 1; not expected)
2015-02-09 11:32:54,124 INFO gave up: test entered FATAL state, too many start retries too quickly
2015-02-09 11:32:55,135 INFO spawned: 'test' with pid 11915
2015-02-09 11:32:56,151 INFO exited: test (exit status 1; not expected)
2015-02-09 11:32:57,153 INFO gave up: test entered FATAL state, too many start retries too quickly
2015-02-09 11:32:58,162 INFO spawned: 'test' with pid 11919
2015-02-09 11:32:59,183 INFO exited: test (exit status 1; not expected)
2015-02-09 11:32:59,249 INFO gave up: test entered FATAL state, too many start retries too quickly
2015-02-09 11:33:00,256 INFO spawned: 'test' with pid 11921
2015-02-09 11:33:01,313 INFO exited: test (exit status 1; not expected)
2015-02-09 11:33:02,315 INFO gave up: test entered FATAL state, too many start retries too quickly
and it continues.
I confirm this is with the latest release of supervisor (3.1.3)
@dalyons
Copy link
Author

dalyons commented Jul 18, 2016

example base supervisord.conf

[unix_http_server]
file=/tmp/supervisor.sock                       ; path to your socket file

[supervisord]
logfile=/var/log/supervisord/supervisord.log    ; supervisord log file
logfile_maxbytes=50MB                           ; maximum size of logfile before rotation
logfile_backups=10                              ; number of backed up logfiles
loglevel=debug                                  ; info, debug, warn, trace
pidfile=/var/run/supervisord.pid                ; pidfile location
nodaemon=false                                  ; run supervisord as a daemon
minfds=1024                                     ; number of startup file descriptors
minprocs=200                                    ; number of process descriptors
user=root                                       ; default user
childlogdir=/var/log/supervisord/               ; where child log files will live

[rpcinterface:supervisor]
supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface

[supervisorctl]
serverurl=unix:///tmp/supervisor.sock         ; use a unix:// URL  for a unix socket

[program:test]
command=/tmp/exit-non-zero.sh
autostart=false
autorestart=false
startsecs=3
stderr_logfile = /tmp/test-stderr.log
stdout_logfile = /tmp/test-stdout.log

[group:mytest]
programs=test

to run

sudo supervisord -n -c supervisord.conf

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment