What would be the simplest way to daemonize a python script in Linux ? I need that this works with every flavor of Linux, so it should only use python based tools.
I have recently used Turkmenbashi :
$ easy_install turkmenbashi
import Turkmenbashi
class DebugDaemon (Turkmenbashi.Daemon):
def config(self):
self.debugging = True
def go(self):
self.debug('a debug message')
self.info('an info message')
self.warn('a warning message')
self.error('an error message')
self.critical('a critical message')
if __name__=="__main__":
d = DebugDaemon()
d.config()
d.setenv(30, '/var/run/daemon.pid', '/tmp', None)
d.start(d.go)