> If it is Python, the c.l.p. should help. If not, then it's a 
> UNIX issue and we'll have to pursue those avenues.

I should have checked the c.l.p. two days ago.  I found a good thread
that gives a few solutions.  If you can manage to get to this url:
http://groups.google.com/groups?hl=en&threadm=008601bde16d%24c449d5e0%24
f29b12c2%40pythonware.com&rnum=1&prev=/groups%3Fq%3Dterminal%2Bdaemon%26
hl%3Den%26group%3Dcomp.lang.python.*%26rnum%3D1%26selm%3D008601bde16d%25
24c449d5e0%2524f29b12c2%2540pythonware.com


It looks like in ThreadedAppServer.py we need to enhance the daemon code
a little.  Either we could do this which is pretty platform neutral:

class BitBucket:
    def write(self, s):
        pass # nobody watches

sys.stdout = sys.stderr = BitBucket()

Or we could do something like this (but it won't work on Windows):

import os, sys
def daemon(nochdir = 0, noclose = 0):
    """Run server as INIT daemon."""
    if os.fork(): os._exit(0)
    os.setsid()
    if nochdir == 0: os.chdir("/")
    if noclose == 0:
        fp = open("/dev/null", "rw")
        sys.stdin = sys.__stdin__ = fp
        sys.stdout = sys.__stdout__ = fp
        sys.stderr = sys.__stderr__ = fp
        del fp
    if os.fork(): os._exit(0)


_______________________________________________
Webware-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/webware-devel

Reply via email to