skillfed

daemonize

Library to enable your code run as a daemon process on Unix-like systems.

daemonize v2.5.0 433.2K downloads/30d#6,703 on PyPI452
Permissive license MIT Abandoned released

What it is and what it does

Daemonize is a minimal library for turning Python scripts into Unix daemon processes. It handles the low-level fork and file descriptor management needed to properly detach a process from the terminal and run it in the background with a PID file. The library accepts a callable, an app name, and a PID file path, then manages the daemonization lifecycle when you call start().

The package is designed for straightforward daemon creation on Unix-like systems (Linux, macOS, BSD). It supports keeping specific file descriptors open—useful for logging—via the keep_fds parameter. However, it has been abandoned since late 2019 and was last tested on Python 2.6, 2.7, 3.3, 3.4, 3.5, so its behavior on modern Python versions and contemporary Unix environments is not guaranteed.

Use it for:

  • Convert a long-running Python script into a background service that survives terminal logout and can be managed via PID file.
  • Create a simple monitoring or maintenance daemon that performs periodic tasks without blocking the shell.
  • Build a lightweight background worker for Unix systems when a full process manager is not available.
  • Daemonize a Python application that needs to log to files while running detached from the controlling terminal.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Daemonize provides a Python library for converting regular Python scripts into Unix daemon processes that run in the background with proper process management.

Yes, but with caution. Daemonize is stable and has no known vulnerabilities, making it suitable for legacy systems or simple one-off daemon scripts on older Python versions. However, do not use it for new projects or for production systems where you need active maintenance and security updates. Consider actively maintained process managers instead.

Install

daemonize on PyPI

pip

pip install daemonize

uv

uv add daemonize

poetry

poetry add daemonize

Installing daemonize

Before you install

Installation is straightforward with no runtime dependencies. However, the package is abandoned—last release was 2018-12-12 and last commit 2019-12-09—so it will not receive bug fixes or security updates.

License in practice

MIT license is permissive and imposes no restrictions on use, modification, or distribution in proprietary or open-source projects.

Quickstart

from daemonize import Daemonize
from time import sleep

def main():
    while True:
        sleep(5)

daemon = Daemonize(app="myapp", pid="/tmp/myapp.pid", action=main)
daemon.start()

Unix-like system required (Linux, macOS, BSD); does not work on Windows. Tested on Python 2.6, 2.7, 3.3, 3.4, 3.5; compatibility with newer versions is unverified.

Verify before relying

  • Whether the package works reliably on Python versions beyond 3.5, given its abandoned status
  • Whether file descriptor handling and signal management remain correct under modern Unix kernels
  • Whether the package is compatible with containerized or systemd-managed environments

Package facts

License MIT (permissive)
Python support not specified
Install friction low — pure-Python wheel
Runtime dependencies none
Maintenance abandoned — 2,802 days since the last release
Last repo commit
First released
Downloads 433,227/month — #6,703 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: daemonize-2.5.0-py2.py3-none-any.whl

Development Status :: 5 - Production/StableEnvironment :: ConsoleIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseOperating System :: MacOS :: MacOS XOperating System :: POSIX :: BSD :: FreeBSDOperating System :: POSIX :: BSD :: NetBSDOperating System :: POSIX :: BSD :: OpenBSDOperating System :: POSIX :: LinuxProgramming Language :: PythonProgramming Language :: Python :: 2.6Programming Language :: Python :: 2.7Programming Language :: Python :: 3Programming Language :: Python :: 3.3Programming Language :: Python :: 3.4Programming Language :: Python :: 3.5Topic :: Software Development

Tags

python daemon processbackground service unixdaemonize python scriptunix daemon librarypython process backgroundingdaemon pid managementunix system daemon
unix-daemonprocess-managementabandoned

More Software Development packages