PEP idea - Daemon

Van Gale news at exultants.org
Wed May 28 00:36:53 EDT 2003


Ryan Morillo wrote:
> Adding in the UID and GID should be easy, I'm not sure what you meen by 
> daemons forking.  If your saying that you loose the PID, thats not a 
> problem (I intend to return the PID), if daemontools needs something 
> else to happen (I can't imagine what), tell me what it is and I'll see 
> what I can do.

What he means by "daemontools" are the utilities from 
<http://cr.yp.to/daemontools.html>.

The "supervise" process from daemontools automatically restarts any 
daemon that exits, which means you don't want to daemonize using fork 
(because supervise will continually try and restart the parent process 
that called exit() after the fork()).

Daemontools also handles uid/gid issues, log rotation, and proper tty 
and file descriptor handling, so really all your package would need for 
compatibility is to make sure there's a "nofork" option available and 
that none of the normal daemonizing code is run when this option is 
specified.

Besides daemontools, this is also useful for debugging of course.





More information about the Python-list mailing list