Back to index

moin  1.9.0~rc2
Classes
MoinMoin.util.daemon Namespace Reference

Classes

class  Error
class  Daemon
class  DaemonScript

Detailed Description

Daemon - daemon script and controller

This module is based on twisted.scripts.twistd, modified by Nir Soffer
to work with non Twisted code.

The Daemon class, represents a background process using a pid
file. When you create an instance, the process may be running or not.
After creating an instance, you can call one of its do_xxx() methods.

The DaemonScript class is a script that control a daemon, with a
functionality similar to apachectl. To create a daemon script, create an
instacne and call its run() method.

Typical usage::

    # Daemon script
    import daemon
    import myserver
    script = daemon.DaemonScript('myserver', 'myserver.pid',
                         myserver.run, myserver.Config)
    script.run()


Copyright (c) 2005 Nir Soffer <nirs@freeshell.org>

Twisted, the Framework of Your Internet
Copyright (c) 2001-2004 Twisted Matrix Laboratories.

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Class Documentation

class MoinMoin::util::daemon::Error
Daemon error 

Definition at line 53 of file daemon.py.