Python package for UNIX/Linux daemon boilerplate
Context manager to eliminate daemonizing boilerplate code.
Install with pip install daemonic
.
Daemonic is pretty easy to use as a context manager:
with daemonic.daemon(
pidfile='/var/run/mydaemon.pid',
stdout=open('/var/log/mydaemon.log', 'a')):
# your daemon code here
daemonic
takes care of:
umask
)