Notice: Google is retiring their OpenID 2.0 authentication service on 20 April 2015. If you are using Google OpenID as your primary means to authenticate on this forum, then please either:

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
33
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>
permanent link

answered 01 Jul '11, 18:48

johns's gravatar image

johns ♦♦
4.3k28
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.

permanent 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

permanent link

answered 02 Jul '11, 03:21

balint80's gravatar image

balint80
33
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

Question tags:

×795
×11
×1

question asked: 01 Jul '11, 18:37

question was seen: 2,133 times

last updated: 02 Jul '11, 03:21

Features & prices    Sign up    Contact us    Affiliate program    Support    Legal    Jobs    Blog    Control panel login
© Copyright 2003-2015 Swarma Limited - WebFaction is a service of Swarma Limited