github.com/hhrutter/nomad@v0.6.0-rc2.0.20170723054333-80c4b03f0705/client/driver/test-resources/docker/main.py (about) 1 import signal 2 import time 3 4 # Setup handler for sigterm so we can exit when docker stop is called. 5 def term(signum, stack_Frame): 6 exit(1) 7 8 signal.signal(signal.SIGTERM, term) 9 10 print ("Starting") 11 12 max = 3 13 for i in range(max): 14 time.sleep(1) 15 print("Heartbeat {0}/{1}".format(i + 1, max)) 16 17 print("Exiting")