Hackfut Security File Manager
Current Path:
/usr/lib/python2.6/site-packages/supervisor
usr
/
lib
/
python2.6
/
site-packages
/
supervisor
/
📁
..
📄
__init__.py
(8 B)
📄
__init__.pyc
(142 B)
📄
__init__.pyo
(142 B)
📄
datatypes.py
(6.49 KB)
📄
datatypes.pyc
(8.88 KB)
📄
datatypes.pyo
(8.83 KB)
📄
http.py
(25.91 KB)
📄
http.pyc
(22.23 KB)
📄
http.pyo
(22.23 KB)
📄
http_client.py
(6.14 KB)
📄
http_client.pyc
(8.55 KB)
📄
http_client.pyo
(8.48 KB)
📁
medusa
📄
options.py
(54.15 KB)
📄
options.pyc
(48.25 KB)
📄
options.pyo
(48.25 KB)
📄
pidproxy.py
(1.75 KB)
📄
pidproxy.pyc
(2.6 KB)
📄
pidproxy.pyo
(2.6 KB)
📄
supervisorctl.py
(20.99 KB)
📄
supervisorctl.pyc
(19.57 KB)
📄
supervisorctl.pyo
(19.57 KB)
📄
supervisord.py
(26.85 KB)
📄
supervisord.pyc
(21.6 KB)
📄
supervisord.pyo
(21.49 KB)
📄
test.py
(114.79 KB)
📄
test.pyc
(114.47 KB)
📄
test.pyo
(114.47 KB)
📁
ui
📄
web.py
(17.15 KB)
📄
web.pyc
(14.67 KB)
📄
web.pyo
(14.67 KB)
📄
xmlrpc.py
(31.89 KB)
📄
xmlrpc.pyc
(27.01 KB)
📄
xmlrpc.pyo
(26.9 KB)
Editing: pidproxy.py
# 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 <pidfile name> <command> [<cmdarg1> ...]" 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()
Upload File
Create Folder