Files
nomad/drivers/docker/test-resources/docker/main.py
2023-08-10 17:27:15 -05:00

21 lines
383 B
Python

# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: BUSL-1.1
import signal
import time
# Setup handler for sigterm so we can exit when docker stop is called.
def term(signum, stack_Frame):
exit(1)
signal.signal(signal.SIGTERM, term)
print ("Starting")
max = 3
for i in range(max):
time.sleep(1)
print("Heartbeat {0}/{1}".format(i + 1, max))
print("Exiting")