Supervisorctl not respecting my configuration

You should run supervisorctl with -c as well. From the documentation (my emphasis): The Supervisor configuration file is conventionally named supervisord.conf. It is used by both supervisord and supervisorctl. If either application is started without the -c option (the option which is used to tell the application the configuration filename explicitly), the application will look … Read more

Stopping supervisord: Shut down

first of all, type this on your console or terminal ps -ef | grep supervisord You will get some pid of supervisord just like these root 2641 12938 0 04:52 pts/1 00:00:00 grep –color=auto supervisord root 29646 1 0 04:45 ? 00:00:00 /usr/bin/python /usr/local/bin/supervisord if you get output like that, your pid is the second … Read more

How to set environment variables in Supervisor service

To add a single environment variable, You can do something like this. [program:django] environment=SITE=domain1 command = python manage.py command But, if you want to export multiple environment variables, you need to separate them by comma. [program:django] environment = SITE=domain1, DJANGO_SETTINGS_MODULE=foo.settings.local, DB_USER=foo, DB_PASS=bar command = python manage.py command

How can I configure supervisord managed program to wait X secs before attemting to restart?

There is no way to specify interval in supervisor program section, but what you could do is put “sleep()” into your code so that after program waits for specified period of time after it finishes with message processing. If you don’t want/cant alter the program code, you may try wrapping it into bash script, for … Read more

how to restart only certain processes using supervisorctl?

supervisord supports process groups. You can group processes into named groups and manage them collectively. [unix_http_server] file=%(here)s/supervisor.sock [supervisord] logfile=supervisord.log pidfile=supervisord.pid [program:cat1] command=cat [program:cat2] command=cat [program:cat3] command=cat [group:foo] programs=cat1,cat3 [supervisorctl] serverurl=unix://%(here)s/supervisor.sock [rpcinterface:supervisor] supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface supervisorctl command can be called with a group name: supervisorctl restart foo: as well as with multiple process names: supervisorctl restart … Read more

Supervisor sock file missing

This happens to me when the physical machine reboots. My machines run Ubuntu, ranging from 12.04 to 16.04. I resolve it by restarting supervisor as a service. sudo service supervisor stop sudo service supervisor start (This somehow works a lot better than simply using ‘restart’) Obviously this is not an ideal fix if you depend … Read more

Supervisord: how to append to $PATH

This feature has been added to Supervisor back in 2014 environment=PATH=”/home/site/environments/master/bin:%(ENV_PATH)s” see https://github.com/Supervisor/supervisor/blob/95ca0bb6aec582885453899872c60b4174ccbd58/supervisor/skel/sample.conf#L7 See also https://stackoverflow.com/questions/12900402/supervisor-and-environment-variables