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 01 Jul '11, 18:37

balint80's gravatar image

balint80
32
accept rate: 0%


Try removing the pipe to null,

> /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,

htop -u <username>
link

answered 01 Jul '11, 18:48

johns's gravatar image

johns ♦♦
4.1k28
accept rate: 23%

Hi Johns,

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

Balint

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

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

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.

link

answered 02 Jul '11, 02:41

tie's gravatar image

tie
1.4k13
accept rate: 44%

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

(02 Jul '11, 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.

(02 Jul '11, 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.

(02 Jul '11, 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

link

answered 02 Jul '11, 03:21

balint80's gravatar image

balint80
32
accept rate: 0%

Your answer
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

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "Title")
  • image?![alt text](/path/img.jpg "Title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×742
×10
×1

Asked: 01 Jul '11, 18:37

Seen: 1,545 times

Last updated: 02 Jul '11, 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