File tree Expand file tree Collapse file tree 1 file changed +11
-7
lines changed Expand file tree Collapse file tree 1 file changed +11
-7
lines changed Original file line number Diff line number Diff line change 1- #!/usr/bin/env python
1+ #!/usr/bin/env python -u
22
3- """ An executable which proxies for a subprocess; upon a signal, it sends that
4- signal to the process identified by a pidfile. """
3+ """pidproxy -- run command and proxy signals to it via its pidfile.
4+
5+ This executable runs a command and then monitors a pidfile. When this
6+ executable receives a signal, it sends the same signal to the pid
7+ in the pidfile.
8+
9+ Usage: %s <pidfile name> <command> [<cmdarg1> ...]
10+ """
511
612import os
713import sys
1016
1117class PidProxy :
1218 pid = None
19+
1320 def __init__ (self , args ):
1421 self .setsignals ()
1522 try :
@@ -32,7 +39,7 @@ def go(self):
3239 break
3340
3441 def usage (self ):
35- print ("pidproxy.py <pidfile name> <command> [<cmdarg1> ...]" )
42+ print (__doc__ % sys . argv [ 0 ] )
3643
3744 def setsignals (self ):
3845 signal .signal (signal .SIGTERM , self .passtochild )
@@ -64,6 +71,3 @@ def main():
6471
6572if __name__ == '__main__' :
6673 main ()
67-
68-
69-
You can’t perform that action at this time.
0 commit comments