Skip to content

CostantinoGrana/python-pidfile

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Python PIDFile

Build Status Latest Version Coverage Status

Python context manager for managing pid files. Example usage:

import pidfile
import time

print('1')
try:
    with pidfile.PIDFile():
        print('2')
        time.sleep(30)
except pidfile.AlreadyRunningError:
    print('Already running.')
print('3')

The context manager will take care of verifying the existence of a pid file, check its pid to see if it's alive, check the command line (which should be <something>/<python name>), and if all the conditions are met, rise a pidfile.AlreadyRunningError exception.

PIDFile() defaults to pidfile for the file name, but it's possible to specify another, e.g. PIDFile('foobar.pid').

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%