~soren/nova/iptables-security-groups

« back to all changes in this revision

Viewing changes to vendor/python-daemon/daemon/__init__.py

  • Committer: Jesse Andrews
  • Date: 2010-05-28 06:05:26 UTC
  • Revision ID: git-v1:bf6e6e718cdc7488e2da87b21e258ccc065fe499
initial commit

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# -*- coding: utf-8 -*-
 
2
 
 
3
# daemon/__init__.py
 
4
# Part of python-daemon, an implementation of PEP 3143.
 
5
#
 
6
# Copyright © 2009–2010 Ben Finney <ben+python@benfinney.id.au>
 
7
# Copyright © 2006 Robert Niederreiter
 
8
#
 
9
# This is free software: you may copy, modify, and/or distribute this work
 
10
# under the terms of the Python Software Foundation License, version 2 or
 
11
# later as published by the Python Software Foundation.
 
12
# No warranty expressed or implied. See the file LICENSE.PSF-2 for details.
 
13
 
 
14
""" Library to implement a well-behaved Unix daemon process.
 
15
 
 
16
    This library implements the well-behaved daemon specification of
 
17
    :pep:`3143`, "Standard daemon process library".
 
18
 
 
19
    A well-behaved Unix daemon process is tricky to get right, but the
 
20
    required steps are much the same for every daemon program. A
 
21
    `DaemonContext` instance holds the behaviour and configured
 
22
    process environment for the program; use the instance as a context
 
23
    manager to enter a daemon state.
 
24
 
 
25
    Simple example of usage::
 
26
 
 
27
        import daemon
 
28
 
 
29
        from spam import do_main_program
 
30
 
 
31
        with daemon.DaemonContext():
 
32
            do_main_program()
 
33
 
 
34
    Customisation of the steps to become a daemon is available by
 
35
    setting options on the `DaemonContext` instance; see the
 
36
    documentation for that class for each option.
 
37
 
 
38
    """
 
39
 
 
40
import version
 
41
from daemon import DaemonContext
 
42
 
 
43
 
 
44
_version = version.version
 
45
_copyright = version.copyright
 
46
_license = version.license
 
47
_url = "http://pypi.python.org/pypi/python-daemon/"