How do I use environment variables in Supervisord's [supervisord] config section?

Viewed 7738

I use environment variables in Supervisord's program section, and they work just fine:

[program:some_prog]
command=%(ENV_env_var_name)s/...

I can't figure out though how to do the same in the [supervisord] section. I tried using the same syntax with and without the ENV_ prefix, but getting the following error:

Traceback (most recent call last):
  File "/usr/local/bin/supervisord", line 9, in <module>
    load_entry_point('supervisor==3.0a12', 'console_scripts', 'supervisord')()
  File "/usr/local/lib/python2.7/dist-packages/supervisor-3.0a12-py2.7.egg/supervisor/supervisord.py", line 356, in main
    options.realize(args, doc=__doc__)
  File "/usr/local/lib/python2.7/dist-packages/supervisor-3.0a12-py2.7.egg/supervisor/options.py", line 419, in realize
    Options.realize(self, *arg, **kw)
  File "/usr/local/lib/python2.7/dist-packages/supervisor-3.0a12-py2.7.egg/supervisor/options.py", line 284, in realize
    self.process_config_file()
  File "/usr/local/lib/python2.7/dist-packages/supervisor-3.0a12-py2.7.egg/supervisor/options.py", line 478, in process_config_file
    Options.process_config_file(self, do_usage=do_usage)
  File "/usr/local/lib/python2.7/dist-packages/supervisor-3.0a12-py2.7.egg/supervisor/options.py", line 292, in process_config_file
    self.read_config(self.configfile)
  File "/usr/local/lib/python2.7/dist-packages/supervisor-3.0a12-py2.7.egg/supervisor/options.py", line 527, in read_config
    section.directory = existing_directory(directory)
  File "/usr/local/lib/python2.7/dist-packages/supervisor-3.0a12-py2.7.egg/supervisor/datatypes.py", line 336, in existing_directory
    nv = v % {'here':here}
KeyError: 'var_name'

Is there a way to achieve that?

1 Answers
Related