cc1  v2.1
CC1 source code docs
 All Classes Namespaces Files Functions Variables Pages
src.cm.utils.threads.daemon.Daemon Class Reference

A generic daemon class. More...

Public Member Functions

def __init__
def daemonize
 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
def delpid
def restart
 Restart the daemon.
def run
 You should override this method when you subclass Daemon.
def start
 Start the daemon.
def stop
 Stop the daemon.

Public Attributes

 pidfile
 stderr
 stdin
 stdout

Detailed Description

A generic daemon class.

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

Definition at line 35 of file daemon.py.

Constructor & Destructor Documentation

def src.cm.utils.threads.daemon.Daemon.__init__ (   self,
  pidfile,
  stdin = '/dev/null',
  stdout = '/dev/null',
  stderr = '/dev/null' 
)

Definition at line 36 of file daemon.py.

Member Function Documentation

def src.cm.utils.threads.daemon.Daemon.daemonize (   self)

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

Definition at line 48 of file daemon.py.

def src.cm.utils.threads.daemon.Daemon.delpid (   self)

Definition at line 88 of file daemon.py.

def src.cm.utils.threads.daemon.Daemon.restart (   self)

Restart the daemon.

Definition at line 149 of file daemon.py.

def src.cm.utils.threads.daemon.Daemon.run (   self)

You should override this method when you subclass Daemon.

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

Definition at line 158 of file daemon.py.

def src.cm.utils.threads.daemon.Daemon.start (   self)

Start the daemon.

Definition at line 95 of file daemon.py.

def src.cm.utils.threads.daemon.Daemon.stop (   self)

Stop the daemon.

Definition at line 117 of file daemon.py.

Member Data Documentation

src.cm.utils.threads.daemon.Daemon.pidfile

Definition at line 40 of file daemon.py.

src.cm.utils.threads.daemon.Daemon.stderr

Definition at line 39 of file daemon.py.

src.cm.utils.threads.daemon.Daemon.stdin

Definition at line 37 of file daemon.py.

src.cm.utils.threads.daemon.Daemon.stdout

Definition at line 38 of file daemon.py.


The documentation for this class was generated from the following file: