python-daemon 2.2.3 Python library for making a Unix daemon process

Python-daemon is a library that assists a Python program to turn itself into a well-behaved Unix daemon process, as specified in PEP 3143.

This library provides a DaemonContext class that manages the following important tasks for becoming a daemon process:

  1. Detach the process into its own process group.

  2. Set process environment appropriate for running inside a chroot.

  3. Renounce suid and sgid privileges.

  4. Close all open file descriptors.

  5. Change the working directory, uid, gid, and umask.

  6. Set appropriate signal handlers.

  7. Open new file descriptors for stdin, stdout, and stderr.

  8. Manage a specified PID lock file.

  9. Register cleanup functions for at-exit processing.