Dead Easy POSIX Daemons for Python!
#!/usr/bin/python import undead @undead def my_daemon_process(): """ This function will be daemonized. """ from time import sleep while True: sleep(10)
pip install undead
Name of the logger and process.
__name__attribute of your decorated callable
Path to pidfile.
The name of the process (that shows up in ps etc.)
Default: None (No manipulation of process name).
import undead undead.name = "my-first-daemon" undead.process_name = "leDeamon" @undead def my_daemon_process(): """ This function will be daemonized. """ # ...
Logging within the decorated handler
log to your decorateds positional arguments and a logger will be passed down. Log away captain!
import undead @undead def i_am_undead(log): log.warning("I'm warning you!") log.info("Soap, 2 for $1.99")
The logfile will be created in