0
votes

I am trying to supervise gunicorn process on my server. But I am getting following error when I start supervisord.

2015-07-31 05:31:58,615 INFO daemonizing the supervisord process
2015-07-31 05:31:58,616 INFO supervisord started with pid 29360
2015-07-31 05:31:59,621 INFO spawned: 'gunicorn' with pid 29362
2015-07-31 05:31:59,811 INFO exited: gunicorn (exit status 0; not expected)
2015-07-31 05:32:00,816 INFO spawned: 'gunicorn' with pid 29369
2015-07-31 05:32:01,019 INFO exited: gunicorn (exit status 0; not expected)
2015-07-31 05:32:03,025 INFO spawned: 'gunicorn' with pid 29385
2015-07-31 05:32:03,214 INFO exited: gunicorn (exit status 0; not expected)
2015-07-31 05:32:06,221 INFO spawned: 'gunicorn' with pid 29395
2015-07-31 05:32:06,407 INFO exited: gunicorn (exit status 0; not expected)
2015-07-31 05:32:07,424 INFO gave up: gunicorn entered FATAL state, too many start retries too quickly

The gunicorn_stdout and gunicorn_stderr log files are empty.

My supervisor config for gunicorn is:

[program:gunicorn]
command=gunicorn -c guni_conf.py run:app
directory=/home/ubuntu/FranklySQL/franklyapi
user=ubuntu
autostart=true
autorestart=true
redirect_stderr=true
exitcodes=1

After I start supervisord the gunicorn workers are started but if i kill any one of them they are not restarted.

I cannot understand this problem. I just want to ensure that gunicorn process always runs on my system and is restarted if it is terminated. I am a new to supervisor and gunicorn. Please help me out.

1
What is in guni_conf.py? Are you actually telling gunicorn to log to stderr using equivalent of --error-logfile - in that file? - Graham Dumpleton

1 Answers

0
votes

I found my mistake. Actually the error was generated because of the configuration file i was using with the command. In the config file I set daemon=true; I commented this argument and after that it was perfectly working.