diff --git a/src/otaclient/ota_core.py b/src/otaclient/ota_core.py index 2308e6a80..775a294e5 100644 --- a/src/otaclient/ota_core.py +++ b/src/otaclient/ota_core.py @@ -869,6 +869,11 @@ def main( ) +def _sign_handler(signal_value, frame) -> NoReturn: + print(f"ota_core process receives {signal_value=}, exits ...") + sys.exit(1) + + def ota_core_process( shm_writer_factory: Callable[[], SharedOTAClientStatusWriter], control_flag: mp_sync.Event, @@ -879,6 +884,7 @@ def ota_core_process( from otaclient.configs.cfg import proxy_info from otaclient.ota_core import OTAClient + signal.signal(signal.SIGTERM, _sign_handler) configure_logging() shm_writer = shm_writer_factory()