Django Supervisord fastcgi config (supervisord.conf) - exits immediately

I am trying to write a supervisord.conf to start django fastcgi process. The only problem is when I execute the fastcgi command, it starts the fastcgi process and immediately appears in the supervisor as "EXITED". (This view hits the vantage point)

Is there a way the supervisor process can be aware that the django fastcgi process is indeed running, but that it is in the background? I've been digging all the supervisord config options, it seems like it should be possible (maybe it can somehow figure it out based on the pid file or something), but I'm a little lost in the documentation.

$ ./ supervisor status
celerybeat                       RUNNING    pid 12575, uptime 0:01:17
celerycam                        RUNNING    pid 12573, uptime 0:01:17
celeryd                          RUNNING    pid 12572, uptime 0:01:17
django                           EXITED     Mar 13 07:57 PM
runserver                        RUNNING    pid 12574, uptime 0:01:17


NOTE. I am actually using django-supervisor to create my config file using variables in the Django context. For the purposes of this example, variables like {{PYTHON}} and {{settings.VIRTUALENV_ROOT}} are simply populated in the obvious way. It should function exactly like a regular supervisor.conf file.

Below is my supervisord.conf file.

$ more supervisord.conf 
logfile={{ settings.VIRTUALENV_ROOT }}/log/supervisord-jj.log
pidfile={{ settings.VIRTUALENV_ROOT }}/var/run/

command={{ PYTHON }} {{ PROJECT_DIR }}/ celeryd  

command={{ PYTHON }} {{ PROJECT_DIR }}/ celerycam

{% if settings.DEBUG %}
{% else %}
{% endif %}

command={{ PYTHON }} {{ PROJECT_DIR }}/ runfcgi  
         method=threaded daemonize=true 
         outlog={{ settings.VIRTUALENV_ROOT }}/log/django-fcgi.log 
         socket={{ settings.VIRTUALENV_ROOT }}/var/run/django-run.socket 
         pidfile={{ settings.VIRTUALENV_ROOT }}/var/run/



Thanks for reading. Any advice is greatly appreciated.


source to share

1 answer

Try it without making django run like a daemon. For the supervisor docs :

Programs designed to run under a supervisor must not demonize themselves. Instead, they should work in the foreground. They should not disconnect from the terminal from which they are launched.



All Articles