From 2dfc36274ddab00fba5dd95232024dd53740e518 Mon Sep 17 00:00:00 2001 From: luto Date: Sun, 9 Apr 2017 16:01:10 +0200 Subject: [PATCH] allow the config file location to be specified in $SUPERVISOR_CONFIG --- docs/configuration.rst | 13 +++++++------ supervisor/options.py | 2 +- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/docs/configuration.rst b/docs/configuration.rst index e99274e75..ed7aa3826 100644 --- a/docs/configuration.rst +++ b/docs/configuration.rst @@ -3,12 +3,13 @@ Configuration File The Supervisor configuration file is conventionally named :file:`supervisord.conf`. It is used by both :program:`supervisord` -and :program:`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 for a file named :file:`supervisord.conf` within the -following locations, in the specified order. It will use the first -file it finds. +and :program:`supervisorctl`. Either application can be starting with +the ``-c`` or ``--configuration`` option, which is used to tell the +application the configuration filename explicitly. Alternatively the +config file can be specified in the ``$SUPERVISOR_CONFIG`` environment +variable. If neither is he application will look for a file named +:file:`supervisord.conf` within the following locations, in the +specified order. It will use the first file it finds. #. :file:`$CWD/supervisord.conf` diff --git a/supervisor/options.py b/supervisor/options.py index 9747e4292..f297cb3c4 100644 --- a/supervisor/options.py +++ b/supervisor/options.py @@ -101,7 +101,7 @@ def __init__(self, require_configfile=True): self.attr_priorities = {} self.require_configfile = require_configfile self.add(None, None, "h", "help", self.help) - self.add("configfile", None, "c:", "configuration=") + self.add("configfile", None, "c:", "configuration=", env="SUPERVISOR_CONFIG") here = os.path.dirname(os.path.dirname(sys.argv[0])) searchpaths = [os.path.join(here, 'etc', 'supervisord.conf'),