blob: bee3a448996e4a15f9358a0f911905b239cc59ef [file] [log] [blame]
#!/uar/bin/env python
import subprocess
import sys
import threading
def watchdog(command, timeout=None):
process = subprocess.Popen(command)
timer = threading.Timer(timeout, process.kill)
try:
timer.start()
process.communicate()
finally:
timer.cancel()
if __name__ == '__main__':
watchdog(sys.argv[2:], timeout=sys.argv[1])