/usr/lib/python2.6/site-packages/supervisor
NameSizeModeActions
medusa/-0755rm
ui/-0755rm
datatypes.py66410644editdlrm
datatypes.pyc90950644editdlrm
datatypes.pyo90470644editdlrm
http.py265330644editdlrm
http.pyc227660644editdlrm
http.pyo227660644editdlrm
http_client.py62910644editdlrm
http_client.pyc87590644editdlrm
http_client.pyo86800644editdlrm
options.py554490644editdlrm
options.pyc494110644editdlrm
options.pyo494110644editdlrm
pidproxy.py17970644editdlrm
pidproxy.pyc26580644editdlrm
pidproxy.pyo26580644editdlrm
supervisorctl.py214970644editdlrm
supervisorctl.pyc200430644editdlrm
supervisorctl.pyo200430644editdlrm
supervisord.py274900644editdlrm
supervisord.pyc221170644editdlrm
supervisord.pyo220040644editdlrm
test.py1175440644editdlrm
test.pyc1172160644editdlrm
test.pyo1172160644editdlrm
web.py175630644editdlrm
web.pyc150220644editdlrm
web.pyo150220644editdlrm
xmlrpc.py326580644editdlrm
xmlrpc.pyc276600644editdlrm
xmlrpc.pyo275420644editdlrm
__init__.py80644editdlrm
__init__.pyc1420644editdlrm
__init__.pyo1420644editdlrm
Edit: /usr/lib/python2.6/site-packages/supervisor/pidproxy.py (1797B)
# An executable which proxies for a subprocess; upon a signal, it sends that # signal to the process identified by a pidfile import os import sys import signal import time class PidProxy: pid = None def __init__(self, args): self.setsignals() try: self.pidfile, cmdargs = args[1], args[2:] self.command = os.path.abspath(cmdargs[0]) self.cmdargs = cmdargs except (ValueError, IndexError): self.usage() sys.exit(1) def go(self): self.pid = os.spawnv(os.P_NOWAIT, self.command, self.cmdargs) while 1: time.sleep(5) try: pid, sts = os.waitpid(-1, os.WNOHANG) except os.error: pid, sts = None, None if pid: break def usage(self): print "pidproxy.py [ ...]" def setsignals(self): signal.signal(signal.SIGTERM, self.passtochild) signal.signal(signal.SIGHUP, self.passtochild) signal.signal(signal.SIGINT, self.passtochild) signal.signal(signal.SIGUSR1, self.passtochild) signal.signal(signal.SIGUSR2, self.passtochild) signal.signal(signal.SIGCHLD, self.reap) def reap(self, sig, frame): # do nothing, we reap our child synchronously pass def passtochild(self, sig, frame): try: pid = int(open(self.pidfile, 'r').read().strip()) except: pid = None print "Can't read child pidfile %s!" % self.pidfile return os.kill(pid, sig) if sig in [signal.SIGTERM, signal.SIGINT, signal.SIGQUIT]: sys.exit(0) if __name__ == '__main__': pp = PidProxy(sys.argv) pp.go()