Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I can't seem to figure out how to append to the default path in a supervisord program config.

I can reset the path:

environment=PATH="/home/site/environments/master/bin"

But when I try:

environment=PATH="/home/site/environments/master/bin:$PATH"

I see that supervisord doesn't evaluate $PATH.

Google wasn't a big help on this for some reason, I cannot believe I'm the first person to need this.

Supervisord must have support for this, any idea what it is?

share|improve this question
    
have you found a solution for this problem? I just have the same issue –  ascobol Jan 16 '12 at 16:07
1  
@ascobol nope, I've hardcoded the path I need, for now –  Prody Jan 17 '12 at 10:36
2  
supervisord don't run shell to preprocess variables in the config file, so you can't use shell expressions to expand variables. Although there is a patch that allows to do %($PATH) and it was discussed in mailing lists back in 2011 but AFAIK it is still not included to the mainline source tree. As a workaround you can create a script that will setup environment and execute a command supplied in arguments. Then you just run the script from the supervisord like command /usr/local/bin/setup_env_master.sh program_name arguments –  Dmitry Vasilyanov Dec 2 '12 at 17:49
    
There is a significant drawback to the shell wrapper solution - when supervisor will try to stop the process using INT or KILL, the signal will be received by the bash script and not the actual wrapped program. This may lead (and leads in my case) to dangling processes. –  stoiczek 2 days ago
add comment

1 Answer

up vote 1 down vote accepted

I reviewed the documentation and agree with Dmitry.

The current answer is: supervisor doesn't do this directory, but creating a wrapper script will help.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.