daemon package
Submodules
Module contents
* Modified generic daemon class *
Author: http://www.jejik.com/articles/2007/02/a_simple_unix_linux_daemon_in_python/
License: http://creativecommons.org/licenses/by-sa/3.0/
- class daemon.Daemon(pidfile, stdin='/dev/null', stdout='/dev/null', stderr='/dev/null', home_dir='.', umask=18, verbose=1, use_gevent=False, use_eventlet=False, use_cleanup=False)[source]
Bases:
object
A generic daemon class.
Usage: subclass the Daemon class and override the run() method.
- cleanup()[source]
You should override this method if you need cleanup handlers on shutdown (ie, prior to sigterm handling) and set use_cleanup to
True
when you subclass Daemon().
- daemonize()[source]
Do the UNIX double-fork magic, see Stevens’ “Advanced Programming in the UNIX Environment” for details (ISBN 0201563177).