6

I was configuring supervisor daemon to be able to start/stop Celery.

It did not work. After debuging back and forth I realized that the problem was that it did not change the working directory to the one mentioned in the directory option in supervisord.conf under program section.

Hopefully there is a workdir in Celery but I am curious - what is the purpose of the directory option then?

If you run a script via supervisor and print pwd it will output /.

11

I had the same problem and managed to resolve it by reversing the order of directory and command options:

e.g. working:

[program:cat]
directory=/var/log
command=cat logfile

NOT working:

[program:cat]
command=cat logfile
directory=/var/log
  • supervisor version 3.1.3 – acidjunk Feb 22 '17 at 14:11
0

here is an example how i got nodejs app with correct ENV working with supervisor

[program:fake-smtp]
directory=/home/web/fake-smtp
command=sh -c 'NODE_ENV=production node src/index.js'
autostart=true
autorestart=true
user=web
redirect_stderr=true
stdout_logfile=/home/web/logs/smtp.log
stderr_logfile=/home/web/logs/smtp.err.log

i hope this helps! this app also requires correct directory.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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