Gunicorn Upstart File Not Starting

Question!

I am trying to launch an app with gunicorn and nginxand have had to double back to delete and change files a few times. This time, I ran into issues.

I first created an upstart file...

sudo nano /etc/init/gunicorn.conf

description "Gunicorn application server handling flowershop"

start on runlevel [2345]
stop on runlevel [!2345]

respawn
setuid ubuntu
setgid www-data
chdir /home/ubuntu/flowershop

exec env/bin/gunicorn --workers 3 --bind unix:/home/ubuntu/flowershop/flowershop.sock flowershop.wsgi:application

Then I ran...

sudo service gunicorn start

and it started!

I had to change the name of the socket it created, so I deleted the /etc/init/gunicorn.conf upstart file, created a new upstart file with the same name as the last and attempted to run sudo service gunicorn start.

It now returns the following error messages that correspond the the following commands...

sudo service gunicorn start

start: Job failed to start

&&

sudo service gunicorn stop

stop: Unknown instance: 

This clearly had to do with my meddling, but I don't have the slightest clue how to fix it.



Answers

Easy way is try to reload your droplet

sudo shutdown -r now
By : Savi


This video can help you solving your question :)
By: admin