Servd
Python daemonizer for Unix, Linux and OS X.
This library is a fork of python-daemon developed originally by serverdensity.
Install
Tested on Python 3.0+, there is no dependencies.
pip install servd
Usage
It has a very simple usage and only requires a pid file to keep track of the daemon. The run() method should be overrided.
from servd import Daemon
class Service(Daemon):
def __init__(self, pidfile) -> None:
super().__init__(pidfile)
def run(self) -> None:
"""Service code."""
service = Service("service.pid")
# Start service daemon
service.start()
# Restart service daemon
service.restart()
# Stop service daemon
service.stop()