Complete Polite Shutdown

DMRlink will now de-register from all peers on a SIGTERM, SIGINT or
SIGQUIT.
This commit is contained in:
Cort Buffington 2014-09-05 08:56:51 -05:00
parent 82d93a759d
commit bc25da467a

View File

@ -48,7 +48,6 @@ parser.add_argument('-c', '--config', action='store', dest='CFG_FILE', help='/fu
cli_args = parser.parse_args()
#************************************************
# PARSE THE CONFIG FILE AND BUILD STRUCTURE
#************************************************
@ -609,6 +608,10 @@ def handler(_signal, _frame):
reactor.stop()
# Set signal handers so that we can gracefully exit if need be
for sig in [signal.SIGTERM, signal.SIGINT, signal.SIGQUIT]:
signal.signal(sig, handler)
#************************************************
#******** ***********
#******** IPSC Network 'Engine' ***********
@ -1244,10 +1247,6 @@ class IPSC(DatagramProtocol):
if __name__ == '__main__':
logger.info('DMRlink \'dmrlink.py\' (c) 2013, 2014 N0MJS & the K0USY Group - SYSTEM STARTING...')
# Set signal handers so that we can gracefully exit if need be
for sig in [signal.SIGTERM, signal.SIGINT, signal.SIGQUIT]:
signal.signal(sig, handler)
networks = {}
for ipsc_network in NETWORK:
if NETWORK[ipsc_network]['LOCAL']['ENABLED']: