Python Daemon library
python-seth is a pretty simple object named Daemon used to daemonize a process.
To do so subclass the Daemon object and override its run method with the code you want to turn into a unix daemon.
You can override the shutdown method which is called on Daemon stop (either via the stop method or on SIGTERM).
Cf. examples for code snippet.