diff --git a/bridge_master.py b/bridge_master.py index 101e11a..8e46188 100644 --- a/bridge_master.py +++ b/bridge_master.py @@ -2747,10 +2747,10 @@ if __name__ == '__main__': except KeyError: pass + #install signal handlers + signal.signal(signal.SIGTERM, sig_handler) + signal.signal(signal.SIGINT, sig_handler) - # Set signal handers so that we can gracefully exit if need be - for sig in [signal.SIGINT, signal.SIGTERM]: - signal.signal(sig, sig_handler) # Create the name-number mapping dictionaries peer_ids, subscriber_ids, talkgroup_ids, local_subscriber_ids, server_ids, checksums = mk_aliases(CONFIG) diff --git a/hotspot_proxy_v2.py b/hotspot_proxy_v2.py index 0fb544d..03ce5c0 100644 --- a/hotspot_proxy_v2.py +++ b/hotspot_proxy_v2.py @@ -362,9 +362,9 @@ if __name__ == '__main__': print('(GLOBAL) SHUTDOWN: PROXY IS TERMINATING WITH SIGNAL {}'.format(str(_signal))) reactor.stop() - # Set signal handers so that we can gracefully exit if need be - for sig in [signal.SIGINT, signal.SIGTERM]: - signal.signal(sig, sig_handler) + #Install signal handlers + signal.signal(signal.SIGTERM, sig_handler) + signal.signal(signal.SIGINT, sig_handler) #readState()