#!
import time, signal
quit = False
def shutdown_all(signum, frame):
global quit
quit = True
if __name__=="__main__":
signal.signal(signal.SIGTERM, shutdown_all)
while not quit:
time.sleep(1)
print 'graceful quit'
验证通过
#!
import time, signal
quit = False
def shutdown_all(signum, frame):
global quit
quit = True
if __name__=="__main__":
signal.signal(signal.SIGTERM, shutdown_all)
while not quit:
time.sleep(1)
print 'graceful quit'