1
# -*- coding: utf-8 -*-
4
# Part of python-daemon, an implementation of PEP 3143.
6
# Copyright © 2009–2010 Ben Finney <ben+python@benfinney.id.au>
7
# Copyright © 2006 Robert Niederreiter
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.
14
""" Library to implement a well-behaved Unix daemon process.
16
This library implements the well-behaved daemon specification of
17
:pep:`3143`, "Standard daemon process library".
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.
25
Simple example of usage::
29
from spam import do_main_program
31
with daemon.DaemonContext():
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.
41
from daemon import DaemonContext
44
_version = version.version
45
_copyright = version.copyright
46
_license = version.license
47
_url = "http://pypi.python.org/pypi/python-daemon/"