daemonize is a library for writing system daemons in Python. It has some old bits from http://daemonize.sourceforge.net/ .