I have a problem deploying Django app using Gunicorn and Supervisor. While I can make Gunicorn serving my app (by setting proper PYTHONPATH and running apropriate command, the one from supervisord config) I can't make supervisor to run it. It just won't see my app. I don't know how to make sure if the config file is ok.

Here's what supervisorctl says:

# supervisorctl start myapp_live
myapp_live: ERROR (no such process)

I'm running it on Ubuntu 10.04 with following config:

File /home/myapp/live/deploy/supervisord_live.ini:

[program:myapp_live]
command=/usr/local/bin/gunicorn_django --log-file /home/myapp/logs/gunicorn_live.log --log-level info --workers 2 -t 120 -b 127.0.0.1:10000 -p deploy/gunicorn_live.pid webapp/settings_live.py
directory=/home/myapp/live
environment=PYTHONPATH='/home/myapp/live/eco/lib'
user=myapp
autostart=true
autorestart=true

In /etc/supervisor/supervisord.conf, at the end of the file, there is:

[include]
files = /etc/supervisor/conf.d/*.conf

and here's a symlink to my config file:

# ls -la /etc/supervisor/conf.d
lrwxrwxrwx 1 root root   48 Dec  4 18:02 myapp-live.conf -> /home/myapp/live/deploy/supervisord_live.ini

everything looks fine for me but supervisorctl just keep saying myapp_live: ERROR (no such process). Any solution for this?

link|improve this question
feedback

3 Answers

up vote 3 down vote accepted

I had the same issue, a

sudo service supervisord reload

did the trick, though I don't know if that is the answer to your question.

link|improve this answer
2  
I stopped and then started supervisor some time ago and it worked. Don't know if reload would work (as I heart restart doesn't) but I guess it could – grucha Dec 21 '10 at 8:41
I did it too and it got worked. I wonder why /etc/init.d/supervisor restart doesn't work when manual stop and start do. – Kirill Feb 29 at 12:33
feedback

Reloading the master supervisor process may work, but it will have unintended side effects if you have more than one process being monitored by supervisor.

The correct way to do it is to issue supervisorctl reread which causes it to scan configuration files for any changes:

root@debian:~# supervisorctl reread
gunicorn: changed

Then, simply reload that app:

root@debian:~# supervisorctl restart gunicorn
gunicorn: stopped
gunicorn: started
link|improve this answer
feedback

I've found the init.d scripts to be unreliable on a variety of different Ubuntu/Debian versions. The way to do it is this:

sudo supervisorctl reload
link|improve this answer
feedback

Your Answer

 
or
required, but never shown

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