I’m running an application from supervisord and I have to set up an environment for it. There are about 30 environment variables that need to be set. I’ve tried putting all on one big
environment=
line and that doesn’t seem to work. I’ve also tried multiple enviroment= lines, and that doesn’t seem to work either. I’ve also tried both with and without ‘ around the env value.
What’s the best way to set up my environment such that it remains intact under supervisord control? Should I be calling my actual program (tornado, fwiw) from a shell script with the environment preloaded there? Ideally, I’d like to put all of the enviroment variables into an include file and load them with supervisor, but I’m open to doing it another way.
UPDATE:
Here is what I’m using in the conf file:
environment=
PYTHONPATH=/srv/obsf/current/:$PYTHONPATH,
PYTHON_EGG_CACHE=/srv/obfs/current/.python-eggs,
OBFS_API_ENVIRONMENT_STAGE=test,
This goes on for about 30 lines, with a lot of environment variables. When I execute the program, it crashes immediately complaining that the environment variable OBFS_API_ENVRIONMENT_STAGE is not set.
As it turns out, the trailing comma is an issue. I quoted all the env strings and removed the trailing comma. All works now.