blackhole.daemon

Provides daemonisation functionality.

class blackhole.daemon.Daemon(*args, **kwargs)[source]

An object for handling daemonisation.

daemonize()[source]

Daemonize the process.

fork()[source]

Fork off the process.

Raises
property pid

Pid of the process, if it’s been daemonised.

Raises

DaemonException – When pid cannot be read from the filesystem.

Returns

The current pid.

Return type

int or None

Note

The pid is retrieved from the filestem. If the pid does not exist in /proc, the pid is deleted.