supervisor.conf default location

mrjj picture mrjj · Sep 1, 2012 · Viewed 32.3k times · Source

Im trying to make automatic deployment including supervisord and confused by default settings path.

Every deployment scheme I found use /etc/supervisor/supervisor.conf and /etc/supervisor/conf.d/ without any presettings and links, also, after installing supervisor package via apt-get this path is really filled by example configuration.

In this example flow looks like this without any links and creation anything like /etc/supervisor.conf:

sudo('apt-get -y install supervisor')
put('config/supervisor_gunicorn.conf', '/etc/supervisor/conf.d/gunicorn.conf', use_sudo=True)
sudo('supervisorctl reload')

But in supervisorctl this path is not specified as default and it's assumed that default location somewhere aroud /etc/supervisor.conf so as specified in manual

I've try to install supervisor all possible ways but I can't get result.

I know that this is just small stupid detail, but I will be very grateful for your assistance in keeping my deployment scheme good.

Answer

Martijn Pieters picture Martijn Pieters · Sep 1, 2012

Normally the default file is indeed /etc/supervisor.conf, but the Debian distribution patches this (link to the gzipped patch as provided by Debian) to look for /etc/supervisor/supervisor.conf first:

--- supervisor-3.0a8.orig/src/supervisor/options.py
+++ supervisor-3.0a8/src/supervisor/options.py
@@ -105,7 +105,7 @@
     def default_configfile(self):
         """Return the name of the found config file or raise. """
         paths = ['supervisord.conf', 'etc/supervisord.conf',
-                 '/etc/supervisord.conf']
+                 '/etc/supervisor/supervisord.conf', '/etc/supervisord.conf']
         config = None
         for path in paths:
             if os.path.exists(path):

So with that patch, supervisor looks for supervisord.conf in the local directory, in the etc/ subdirectory, then in the global /etc/supervisor/ and /etc/ directories.

The default supervisord.conf file installed by Debian has this at the end:

[include]
files = /etc/supervisor/conf.d/*.conf

causing supervisord to load any extra files put in the conf.d directory.