Skip to content

ericsuh/daemonic

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Daemonic

Context manager to eliminate daemonizing boilerplate code.

Installation

Install with pip install daemonic.

Use

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:

  • Forking twice to detach from the current terminal/process
  • Changing to a different working directory
  • Managing user file creation permissions (umask)
  • Redirecting standard input/output/error
  • Creating a locked PID file

License

MIT license.

About

Python package for UNIX/Linux daemon boilerplate

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published