django-utils v0.3.0 documentation

This Page

Daemon

A class that encapsulates the initialization required by a well-behaved daemon. Based on the code found here: http://www.jejik.com/articles/2007/02/a_simple_unix_linux_daemon_in_python/

class djutils.daemon.Daemon(object)
__init__(self, pidfile, stdin='/dev/null', stdout='/dev/null', stderr='/dev/null')
Parameters:
  • pidfile – full path to file in which to store pid of daemon
  • stdin – file to use for stdin
  • stdout – file to use for stdout
  • stderr – file to use for stderr
run(self)

override this method with your daemon code

See an example in djutils.queue.bin.consumer