--- id: python-daemon version: "3.1.2" license: Copying this work ################# ‘python-daemon’ is under Copyright © 2008–2024 Ben Finney and others. This work, ‘python-daemon’, is free software: you may copy, modify, and/or distribute this… (full text in the JSON record) license_treatment: permissive maintenance: dormant --- # python-daemon — Library to implement a well-behaved Unix daemon process. License: permissive · Maintenance: dormant · Downloads: 21.1M/mo ## What it is and what it does python-daemon is a library that implements the PEP 3143 standard for well-behaved Unix daemon processes. Creating a daemon—a process that runs in the background detached from the terminal—requires several tricky steps: forking, closing file descriptors, handling signals, and setting up the process environment correctly. This library encapsulates all of that complexity into a simple context manager interface, so you can wrap your main program logic and let DaemonContext handle the daemon setup automatically. You configure the daemon by setting options on a DaemonContext instance (signal handlers, working directory, file descriptors to preserve, etc.) and then use it as a context manager. The library depends only on lockfile for file-based locking during the daemonization process. It requires Python 3.7 or later and runs only on POSIX systems. Use it for: - Long-running background services (log aggregators, monitoring agents, scheduled job runners) that need to detach from the terminal. - System utilities that must fork and run as true Unix daemons with proper signal handling and file descriptor management. - Applications that need to customize daemon behavior (e.g., preserve specific file descriptors, set working directory, manage pidfiles). ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Implements PEP 3143 well-behaved Unix daemon processes, handling the complex steps of forking and process environment setup so your program can run reliably in the background. Yes, if you are building a Unix daemon in Python and want to follow PEP 3143 correctly without reimplementing the forking and setup logic yourself. The dormant maintenance status is not a blocker—the package is feature-complete and stable—but verify that it meets your Python version and OS requirements. Not suitable for Windows. ## Install pip install python-daemon uv add python-daemon poetry add python-daemon ## Installing python-daemon Before you install: Low install friction with a single lightweight dependency (lockfile). Maintenance is dormant—last release was 619 days ago—but the package is marked Production/Stable and has been actively maintained since 2009, suggesting it is feature-complete and unlikely to require frequent updates. License in practice: Dual-licensed under Apache License 2.0 (daemon library) and GNU General Public License version 3+ (packaging and tests). Permissive treatment means you can use, modify, and distribute freely, but be aware of the GPL v3 component if you redistribute the package itself. Quickstart: pip install python-daemon import daemon with daemon.DaemonContext(): # Your background process code here pass Unix/POSIX systems only; not supported on Windows. Verify before relying: - Whether dormant maintenance status (last release 619 days ago) poses a risk for future Python or OS compatibility. - Specific behavior differences or limitations when used with modern async frameworks or process managers. ## Package facts - License: Copying this work ################# ‘python-daemon’ is under Copyright © 2008–2024 Ben Finney and others. This work, ‘python-daemon’, is free software: you may copy, modify, and/or distribute this… (full text in the JSON record) (permissive) - Python support: supports_current - Install friction: low - Maintenance: dormant - Downloads: 21.1M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags unix daemon process library, background process management, PEP 3143 daemon, fork and daemonize, well-behaved daemon, python daemon context manager, unix-daemon, background-process, posix-only [View on SkillFed](https://skillfed.io/packages/python-daemon) · [View on PyPI](https://pypi.org/project/python-daemon/)