[Fixed]-Django โ€“ Supervisor : exited too quickly

11๐Ÿ‘

โœ…

The issue is that you are missing the directory=... in your config file

[program:sitepro]
command = /home/user/sitepro/bin/gunicorn sitepro.wsgi:application --bind mywebsite.fr:8002
directory = /home/user/sitepro/site
user = user
autostart = true
autorestart = true

Otherwise gunicorn will not know where to find sitepro.wsgi:application

๐Ÿ‘คTarun Lalwani

6๐Ÿ‘

To see what is going on, you should log the supervisor output.

To do that, open the supervisor .conf file, and add the following lines:

stdout_logfile={Path}
stderr_logfile={Path}
autostart=true
autorestart=true
startsecs=10

A possible {Path} could be /home/{youruser}/sitepro.log

Restart supervisor

supervisorctl restart sitepro

Once restarted, go to the log and tell us what you see.

๐Ÿ‘คDaniel Julian

0๐Ÿ‘

in my .conf (supervisor) file:

command = /home/user/sitepro/bin/gunicorn sitepro.wsgi:application --bind mywebsite.fr:8002

Double-check the directory path: (/home/user/sitepro/bin/gunicorn sitepro.wsgi:application)

You may have inputted the incorrectly path

๐Ÿ‘คHoangYell

Leave a comment