Deiman is a Python utility class for daemonizing a process. It has start and stop methods as well as a method for retrieving a process status information. It can also detect stale PIDs and remove them.

Deiman uses the Unix double fork method to push the process to the background.

Linux/Unix only, untested on Mac OS.


From PyPI

pip install deiman

From GitHub

pip install -e git+git://

From source

Download the latest tarball from PyPI or GitHub. Unpack and run:

python install


To use Deiman, you simply need to import the main Deiman class, passing a path to where you want the pid to be stored and call the start and stop methods as required

from deiman import Deiman

d = Deiman("/tmp/")

while True:
    print "This print will be hidden because I am daemonized"


See the examples directory for usage examples on GitHub.


Anarchist. Pessimist. Bipolar. Hacker. Hyperpolyglot. Musician. Ex-(semi-)pro gamer. They/Them.

View Source