Lightweight Python module for daemonizing
Project description
Description
succubus is a lightweight python module for a fast and easy creation of python daemons.
Examples
import logging
import sys
from logging.handlers import WatchedFileHandler
from succubus import Daemon
class MyDaemon(Daemon):
def __init__(self, *args, **kwargs):
super(MyDaemon, self).__init__(*args, **kwargs)
def run(self):
"""Overwrite the run function of the daemon class"""
handler = WatchedFileHandler('succubus.log')
self.logger = logging.getLogger('succubus')
self.logger.addHandler(handler)
while True:
time.sleep(1)
self.logger.warn('Hello world')
def main():
daemon = MyDaemon(pid_file='succubus.pid')
sys.exit(daemon.action())
if __name__ == '__main__':
main()
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
succubus-1.0-11.tar.gz
(3.4 kB
view hashes)