Daemonize?

Oren Tirosh oren-py-l at hishome.net
Wed Sep 4 14:57:04 EDT 2002


On Wed, Sep 04, 2002 at 08:36:57AM -0500, sismex01 at hebmex.com wrote:
> Sorry to ask here, but I don't have any "unixy" python
> documentation at hand.
> 
> Normally, I put an app into "daemon" mode, by first
> forking, then reopening stdin/out/err to /dev/null,
> and then forking again. Works good enough for my
> purposes.
> 
> But, am I right? Is this the correct way to do this?
> Also, I can't find any "reopen" in python to apply
> to sys.stdin/out/err.

No need to do anything to the sys.std* objects - you can manipulate
the underlying file handles directly with os.close, os.dup2, etc. 

	Oren





More information about the Python-list mailing list