login community faq

Hi all,

Trying to set up nginx + django and followed the descriptions here: http://forum.webfaction.com/viewtopic.php?id=1981 everything works fine

Everything works fine as long as I run django like this: python2.7 manage.py runfcgi maxchildren=1 maxspare=1 minspare=1 method=prefork socket=$PWD/django.sock pidfile=django.pid daemonize=false

But when I try running it in the background, like this: python2.7 manage.py runfcgi maxchildren=1 maxspare=1 minspare=1 method=prefork socket=$PWD/django.sock pidfile=django.pid daemonize=true > /dev/null 2>&1 & it just quits. Can't see any error messages anywhere, it's not there in the processes, it's definitely not running.

Am I not allowed to do this via ssh? Should it be done somehow from the console?

Any help, suggestion appreciated!

Thanks, Balint

asked Jul 01 '11 at 18:37

balint80's gravatar image

balint80
32


Try removing the pipe to null,

1
> /dev/null 2>&1

There is no reason daemonize should not work, It is how apache or gunicorn work. What happens if you open another SSH terminal and swatch your processes in real-time? This can be done with the htop command,

1
htop -u <username>

answered Jul 01 '11 at 18:48

johns's gravatar image

johns ♦♦
340427

Hi Johns,

Same thing. The process flashes up in htop for a second then disappears. (Both with or without the dev null)

Balint

(Jul 02 '11 at 02:29) balint80 balint80's gravatar image

You could try redirecting the output of that command to some file by running something like:

1
python2.7 manage.py runfcgi maxchildren=1 maxspare=1 minspare=1 method=prefork socket=$PWD/django.sock pidfile=django.pid daemonize=true > $HOME/django_fcgi.log 2>&1

This should record the entire output, along with any error messages to $HOME/django_fcgi.log. You can check the contents of that file for clues about why "daemonize=true" is crashing.

answered Jul 02 '11 at 02:41

tie's gravatar image

tie
139113

Thanks for your reply. The log file gets created but remains empty. :(

(Jul 02 '11 at 02:50) balint80 balint80's gravatar image

Hm this is weird, even if I do something obviously wrong (like maxspare < minspare) I don't get anything in the log. If I do that with daemonize=false I see the relevant error.

(Jul 02 '11 at 02:54) balint80 balint80's gravatar image

Could youplease try dropping the last "&" off the command you are running? It should not be needed with daemonize=true.

(Jul 02 '11 at 03:08) tie tie's gravatar image

Guuuys! Got it working now!! :) It was the "pidfile=django.pid". Need to use an absolute path here as well (Daaaa...) Thanks for your time and the responses!

Balint

answered Jul 02 '11 at 03:21

balint80's gravatar image

balint80
32

Your answer
If you have an answer to the above question, then use the form below. Otherwise, use the appropriate 'add new comment' button above to post your feedback.
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Tags:

×643
×9
×1

Asked: Jul 01 '11 at 18:37

Seen: 1,043 times

Last updated: Jul 02 '11 at 03:21

Plans & prices    Sign up    Why WebFaction?    Contact us    Affiliate program    Support    Legal    Jobs    Blog    Control panel login
Powered by OSQA
© Copyright 2003-2012 Swarma Limited - WebFaction is a service of Swarma Limited