Yet another python Daemon implementation
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
examples Removed ugly prefix; ex from basic usage example Dec 11, 2011

YapDi - Yet another python Daemon implementation


As the name implies YapDi is yet another python daemon implementation. Python 2.x standard library didn't have a daemonizing module. It is one of those rare few modules python standard library lacked that put the phrase "batteries included" to shame. There is PEP 3143 which introduces a daemonizing package to python 3.x standard library.

Python community is scattered with so many daemon implementations and this is one of them. This module is a modified version of a code originally posted here. So any compliments should go there first.


python install

Basic Usage

import yapdi

# Creating a yapdi daemon instance
daemon = yapdi.Daemon()

# You can also supply a pid file name at daemon instance creation time
daemon = yapdi.Daemon(pidfile='/var/run/')

# Daemonizing an instance; Any code placed under this would get executed in daemon mode

# Stopping a running instance

# Restarting an instance; If an instance is already running it would be killed and started again, else would just start

# Checking whether an instance is running
if daemon.status():
    print('An instance is already running')
    print('No instance is running')

# Running a daemonized instance as a different user; any code below these two lines would get executed in daemon mode as user 'user123'