baseimage-tutorial-framework/tfw/main/signal_handling.py
2019-07-24 15:50:41 +02:00

12 lines
256 B
Python

from signal import signal, SIGTERM, SIGINT
from tfw.internals.event_handling import EventHandler
def setup_signal_handlers():
def stop(*_):
EventHandler.stop_all_instances()
exit(0)
signal(SIGTERM, stop)
signal(SIGINT, stop)