From dec8ec637c275d69638894d36e285d8be4c60f71 Mon Sep 17 00:00:00 2001 From: Evan Purkhiser Date: Tue, 10 Feb 2015 03:50:17 -0800 Subject: [PATCH] Search user configuration directories for config --- supervisor/options.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/supervisor/options.py b/supervisor/options.py index f3cce2680..fee6b6138 100644 --- a/supervisor/options.py +++ b/supervisor/options.py @@ -104,10 +104,14 @@ def __init__(self, require_configfile=True): self.add(None, None, "h", "help", self.help) self.add("configfile", None, "c:", "configuration=") + default_userdir = os.path.join(os.environ['HOME'], '.config') + userdir = os.environ.get('XDG_CONFIG_HOME', default_userdir) + here = os.path.dirname(os.path.dirname(sys.argv[0])) searchpaths = [os.path.join(here, 'etc', 'supervisord.conf'), os.path.join(here, 'supervisord.conf'), 'supervisord.conf', + os.path.join(userdir, 'supervisor', 'config.conf'), 'etc/supervisord.conf', '/etc/supervisord.conf'] self.searchpaths = searchpaths