Skip to content
daemonize is a library for writing system daemons in Python.
Branch: master
Clone or download
thesharp daemonize 2.5.0
Update Makefile
Change webhook url
Fix deprecation warnings for logger.warn()
Only hard edit when there's processes to maintain
fix(travis): update notification webhook
Latest commit 39a880f Dec 12, 2018
Type Name Latest commit message Commit time
Failed to load latest commit information.
docs Remove api docs from readme Nov 2, 2015
.travis.yml fix(travis): update notification webhook Dec 12, 2018
LICENSE Document verbose parameter, update LICENSE. Mar 14, 2014 Add sphinx-doc, migrate to rst in readme Nov 2, 2015
Makefile Update Makefile Jul 28, 2016
README.rst A little bit more verbose README.rst. Dec 3, 2015 daemonize 2.5.0 Dec 12, 2018
setup.cfg Let's also build .whl now. Dec 13, 2015 Confirm NetBSD support Mar 18, 2016



Latest version Travis CI PyPI montly downloads PyPI last version available PyPI license

daemonize is a library for writing system daemons in Python. It is distributed under MIT license. Latest version can be downloaded from PyPI. Full documentation can be found at ReadTheDocs.


It is tested under following Python versions:

  • 2.6
  • 2.7
  • 3.3
  • 3.4
  • 3.5


You can install it from Python Package Index (PyPI):

$ pip install daemonize


from time import sleep
from daemonize import Daemonize

pid = "/tmp/"

def main():
    while True:

daemon = Daemonize(app="test_app", pid=pid, action=main)

File descriptors

Daemonize object's constructor understands the optional argument keep_fds which contains a list of FDs which should not be closed. For example:

import logging
from daemonize import Daemonize

pid = "/tmp/"
logger = logging.getLogger(__name__)
logger.propagate = False
fh = logging.FileHandler("/tmp/test.log", "w")
keep_fds = []

def main():

daemon = Daemonize(app="test_app", pid=pid, action=main, keep_fds=keep_fds)
You can’t perform that action at this time.