The freezer_dr.common.daemon Module

The freezer_dr.common.daemon Module

Generic deamon.

class freezer_dr.common.daemon.Daemon(pidfile, stdin='/dev/null', stdout='/dev/null', stderr='/dev/null')[source]

Bases: object

A generic daemon class.

Usage: subclass the Daemon class and override the run() method

daemonize()[source]

Do the UNIX double-fork magic.

See Stevens’ “Advanced Programming in the UNIX Environment” for details (ISBN 0201563177) http://www.erlenstar.demon.co.uk/unix/faq_2.html#SEC16

delpid()[source]

Delete PID file.

restart()[source]

Restart the daemon.

run()[source]

You should override this method when you subclass Daemon.

It will be called after the process has been daemonized by start() or restart().

start()[source]

Start the daemon.

status()[source]

Check daemon status.

stop()[source]

Stop the daemon.

Creative Commons Attribution 3.0 License

Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.