Python code to run as a daemon

Status
Not open for further replies.

falcolas

Ars Scholae Palatinae
748
Used this forever, and it works pretty much perfectly. No fancy context manager, just a function call (which I typically wrap in an if-statement tied to a --no-daemonize command line option for debugging).

http://code.activestate.com/recipes/278731/

Just be aware if you use this that it will close open logging handles, and you'll have to re-create them after turning into a daemon.
 
Status
Not open for further replies.