baseimage-tutorial-framework/lib/tfw/main/signal_handling.py

12 lines
246 B
Python
Raw Normal View History

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