Skip to content

Commit

Permalink
Add /etc/supervisor/supervisord.conf to the search paths.
Browse files Browse the repository at this point in the history
Closes #414
  • Loading branch information
mnaberez committed May 10, 2016
1 parent c888d0b commit 15c5d6f
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 10 deletions.
6 changes: 6 additions & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
3.3.0 (Next 3.x Release)
------------------------

- ``/etc/supervisor/supervisord.conf`` has been added to the config file search
paths. Many versions of Supervisor packaged for Debian and Ubuntu have
included a patch that added this path. This difference was reported in a
number of tickets as a source of confusion and upgrade difficulties, so the
path has been added. Patch by Kelvin Wong.

- Glob patterns in the ``include`` section now support the ``host_node_name``
expansion. Patch by Paul Lockaby.

Expand Down
10 changes: 5 additions & 5 deletions docs/configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,17 @@ file it finds.

#. :file:`/etc/supervisord.conf`

#. :file:`/etc/supervisor/supervisord.conf` (since Supervisor 3.3.0)

#. :file:`../etc/supervisord.conf` (Relative to the executable)

#. :file:`../supervisord.conf` (Relative to the executable)

.. note::

Some distributions have packaged Supervisor with their own
customizations. These modified versions of Supervisor may load the
configuration file from locations other than those described here.
Notably, Ubuntu packages have been found that use
``/etc/supervisor/supervisord.conf``.
Many versions of Supervisor packaged for Debian and Ubuntu included a patch
that added ``/etc/supervisor/supervisord.conf`` to the search paths. The
first PyPI package of Supervisor to include it was Supervisor 3.3.0.

File Format
-----------
Expand Down
4 changes: 3 additions & 1 deletion supervisor/options.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,9 @@ def __init__(self, require_configfile=True):
os.path.join(here, 'supervisord.conf'),
'supervisord.conf',
'etc/supervisord.conf',
'/etc/supervisord.conf']
'/etc/supervisord.conf',
'/etc/supervisor/supervisord.conf',
]
self.searchpaths = searchpaths

self.environ_expansions = {}
Expand Down
11 changes: 7 additions & 4 deletions supervisor/tests/test_options.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,10 +159,13 @@ def test_add_duplicate_long_option_key(self):

def test_searchpaths(self):
options = self._makeOptions()
self.assertEqual(len(options.searchpaths), 5)
self.assertTrue('supervisord.conf' in options.searchpaths)
self.assertTrue('etc/supervisord.conf' in options.searchpaths)
self.assertTrue('/etc/supervisord.conf' in options.searchpaths)
self.assertEqual(len(options.searchpaths), 6)
self.assertEqual(options.searchpaths[-4:], [
'supervisord.conf',
'etc/supervisord.conf',
'/etc/supervisord.conf',
'/etc/supervisor/supervisord.conf',
])

def test_options_and_args_order(self):
# Only config file exists
Expand Down

0 comments on commit 15c5d6f

Please sign in to comment.