5

I need to proxy multiple environment variables from /etc/environment to a process managed by a supervisor.

The following configuration worked for me with supervisor 3.0r1-1 but supervisor 3.2.0-2 reports an error:

environment=FOO=$FOO,BAR=$BAR,BAZ=$BAZ 

Error: Unexpected end of key/value pairs in value...

Some answers suggest to quote the values but if I do so, the variables wouldn't be expanded to real values.

What am I doing wrong? How to fix it?

1 Answer 1

11

According to http://supervisord.org/configuration.html?highlight=environment, have you tried putting them all on one line?

environment=A="1",B="2" 

(that is, = is used for both environment itself and for the key-value pairs, separated by commas, with the values bounded with quotation marks)

Also, where does $FOO come from? http://supervisord.org/subprocess.html#subprocess-environment says 'No shell is executed by supervisord when it runs a subprocess' so its not clear how you expect $FOO to work.

5
  • $FOO is an environment variable. Commented May 29, 2017 at 20:59
  • From where though? Supervisord isn't passing that to a shell, so its not going to know how to handle it other than as a string. Commented May 29, 2017 at 21:00
  • 1
    Subprocesses will inherit the environment of the shell used to start the supervisord program. $FOO is an environment variable of the shell used to start the supervisord program. Commented May 29, 2017 at 21:00
  • 2
    I defined those variables in /etc/environment. Commented May 29, 2017 at 21:04
  • @Kolyunya so did it, why it's not reading these variables ? Commented May 23, 2023 at 8:34

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.