Complete Polite Shutdown
DMRlink will now de-register from all peers on a SIGTERM, SIGINT or SIGQUIT.
This commit is contained in:
		
							parent
							
								
									82d93a759d
								
							
						
					
					
						commit
						bc25da467a
					
				@ -48,7 +48,6 @@ parser.add_argument('-c', '--config', action='store', dest='CFG_FILE', help='/fu
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
cli_args = parser.parse_args()
 | 
					cli_args = parser.parse_args()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 | 
				
			||||||
#************************************************
 | 
					#************************************************
 | 
				
			||||||
#     PARSE THE CONFIG FILE AND BUILD STRUCTURE
 | 
					#     PARSE THE CONFIG FILE AND BUILD STRUCTURE
 | 
				
			||||||
#************************************************
 | 
					#************************************************
 | 
				
			||||||
@ -609,6 +608,10 @@ def handler(_signal, _frame):
 | 
				
			|||||||
    
 | 
					    
 | 
				
			||||||
    reactor.stop()
 | 
					    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'    ***********
 | 
					#********    IPSC Network 'Engine'    ***********
 | 
				
			||||||
@ -1244,10 +1247,6 @@ class IPSC(DatagramProtocol):
 | 
				
			|||||||
if __name__ == '__main__':
 | 
					if __name__ == '__main__':
 | 
				
			||||||
    logger.info('DMRlink \'dmrlink.py\' (c) 2013, 2014 N0MJS & the K0USY Group - SYSTEM STARTING...')
 | 
					    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 = {}
 | 
					    networks = {}
 | 
				
			||||||
    for ipsc_network in NETWORK:
 | 
					    for ipsc_network in NETWORK:
 | 
				
			||||||
        if NETWORK[ipsc_network]['LOCAL']['ENABLED']:
 | 
					        if NETWORK[ipsc_network]['LOCAL']['ENABLED']:
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user