Skip to main content

Lightweight and no-nonsense POSIX daemon library for Python (2.x.x/3.x.x)

Project description

Daemonator ( Formerly Daemon-Python

Lightweight and no-nonsense POSIX daemon library. Extensible, complete
with process forking and
`PID <>`__ management.

Inspired by `Sander
Marechal <>`__.


MIT/X11 - See
`LICENSE <>`__

Getting Started



# git clone
# cd daemon-py/
# python install

1. **Instantiation**


import daemon
class MyDaemon(daemon.Daemon):
"""Subclass Daemon-Python."""
def run(self):
"""Define what to daemonize by implementing the run() method."""

2. **Implementing control**

Finally, we want to be able to control our daemon.


if __name__ == "__main__":
daemon = MyDaemon('/tmp/') #Define a pidfile location (typically located in /tmp or /var/run)
if len(sys.argv) == 2:
if 'start' == sys.argv[1]:
elif 'stop' == sys.argv[1]:
elif 'restart' == sys.argv[1]:
elif 'status' == sys.argv[1]:
sys.stdout.write("Unknown command\n")
sys.stdout.write("Usage: %s start|stop|restart|status\n" % sys.argv[0])

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for daemonator, version
Filename, size File type Python version Upload date Hashes
Filename, size daemonator- (3.7 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page