tests/killdaemons.py
branchstable
changeset 1128 7f09e7ac63a7
parent 1127 79d7aa832cf4
child 1329 10d0d9d5c0f0
equal deleted inserted replaced
1127:79d7aa832cf4 1128:7f09e7ac63a7
     1 #!/usr/bin/env python
     1 #!/usr/bin/env python
     2 
     2 
     3 import os, time, errno, signal
     3 import os, sys, time, errno, signal
     4 
     4 
     5 if os.name =='nt':
     5 if os.name =='nt':
     6     import ctypes
     6     import ctypes
     7     def kill(pid, logfn, tryhard=True):
     7     def kill(pid, logfn, tryhard=True):
     8         logfn('# Killing daemon process %d' % pid)
     8         logfn('# Killing daemon process %d' % pid)
    47             os.unlink(pidfile)
    47             os.unlink(pidfile)
    48     except IOError:
    48     except IOError:
    49         pass
    49         pass
    50 
    50 
    51 if __name__ == '__main__':
    51 if __name__ == '__main__':
    52     killdaemons(os.environ['DAEMON_PIDS'])
    52     path, = sys.argv[1:]
       
    53     killdaemons(path)
    53 
    54