I have this upstart script I made using the tutorial at https://www.digitalocean.com/community/tutorials/how-to-set-up-django-with-postgres-nginx-and-gunicorn-on-ubuntu-14-04. Except I don't use virtualenv so I just have 'exec gunicorn'
description "Test Django project"
start on runlevel [2345]
stop on runlevel [!2345]
respawn
setuid userx
setgid www-data
chdir /home/mahsan/Documents/Test
exec gunicorn --workers 3 --bind unix:/home/userx/Documents/Test/Test.sock Test.wsgi:application
Using grep :init /var/log/syslog
I find this:
Apr 2 15:31:24 backbox kernel: [ 5296.877715] init: gunicorn main process ended, respawning Apr 2 15:31:24 backbox kernel: [ 5296.991094] init: gunicorn main process (4247) terminated with status 1 Apr 2 15:31:24 backbox kernel: [ 5296.991133] init: gunicorn main process ended, respawning Apr 2 15:31:24 backbox kernel: [ 5297.102330] init: gunicorn main process (4249) terminated with status 1 Apr 2 15:31:24 backbox kernel: [ 5297.102359] init: gunicorn main process ended, respawning Apr 2 15:31:24 backbox kernel: [ 5297.217514] init: gunicorn main process (4251) terminated with status 1 Apr 2 15:31:24 backbox kernel: [ 5297.217528] init: gunicorn respawning too fast, stopped Apr 2 15:40:04 backbox kernel: [ 5817.334970] init: gunicorn main process (4533) terminated with status 1
However, when I do run exec gunicorn --workers 3 --bind unix:/home/userx/Documents/Test/Test.sock Test.wsgi:application
from the directory that manage.py is in it starts without incident. Then when I do ps ax | grep gunicorn
I see the workers show up.
Any idea what I am doing wrong here?
ls /var/log/ | grep 'gunicorn'
andls /var/log/upstart | grep 'gunicorn'
both come up empty and there doesn't seem to be a /var/log/init dir. – MAhsan