I am running Django on a centos box using lighttpd and fastcgi. I
found that if I didn't daemonize the fastcgi process and did not
specify a socket name to the manage.py script that the fcgi handlers
cooperated better and was able to place all of the fcgi process under
the control of lighttpd and thus multiple sockets are created, load
balancing happens and the fcgi processes are started and stopped by
lighttpd when it starts and stops.

The problem is that I am loosing stdout and stderr.

In django/core/servers/fastcgi.py stdout and stderr are only honored
by the runfcgi command IF you are going to daemonize. So I poked at
the code and added this else clause at line 166:

    if daemonize:
        from django.utils.daemonize import become_daemon
        become_daemon(our_home_dir=options["workdir"],
**daemon_kwargs)
+   else:
+      if options['outlog']:
+           so = open(options['outlog'], 'a+', 0)
+           os.dup2(so.fileno(), sys.stdout.fileno())
+       if options['errlog']:
+           se = open(err_log, 'a+', 0)
+           os.dup2(se.fileno(), sys.stderr.fileno())

At which point I started getting the stdout and stderr messages. But
that seems to have broken something else with the fcgi setup. So I
obviously missed something about this.

Any suggestions?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to