Joe Lin
Joe Lin

Reputation: 633

django nginx gunicorn,, start: Job failed to start

every one I am trying to deploying django project using nginx gunicorn,,but when I run

sudo service gunicorn start, it said, start: Job failed to start,

here it the working path,, enter image description here

the gunicorn.conf file

/etc/init/gunicorn.conf

description "Gunicorn application server handling myproject"

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

respawn
setuid user
setgid www-data
chdir /home/parallels/books/mysite


exec myprojectenv/bin/gunicorn --workers 3 --bind unix:/home/parallels/books/mysite/mysite.sock mysite.wsgi:application

when I run

gunicorn --bind 0.0.0.0:8000 mysite.wsgi:application

I can see mysite running

enter image description here

but when I try

sudo service gunicorn start

fail,,, enter image description here I just following the instruction here

any one who can reply thank you very much

Upvotes: 2

Views: 2804

Answers (3)

Mark Mishyn
Mark Mishyn

Reputation: 4151

I know this is too late, but in any case:

  1. In your gunicorn.conf I see setuid user but there is user parallels in your prompt (it depends of your bash settings, but probably it is name of curent user).
  2. There is chdir /home/parallels/books/mysite and then exec myprojectenv/bin/gunicorn and I guess your gunicorn location is not /home/parallels/books/mysite/myprojectenv/bin/gunicorn. So you need to use appropriate path to run gunicorn.

Check gunicorn log file to find out problems. It should be here /var/log/upstart/gunicorn.log

Upvotes: 3

JDP
JDP

Reputation: 385

Check the exec command and its parameters. If you have any problem in that it will fail

In my case I missed bin after venv (virtual env) path. ie exec myprojectenv/bin/gunicorn --workers 3 --bind ...

Upvotes: 1

Oliver Hu
Oliver Hu

Reputation: 148

You need to update setuid user to your user name and also the path.

Upvotes: 2

Related Questions