def sigterm_handler(signum, frame):
 logger.info(u'Got SIGTERM signal. Exiting...')
 exit_process()

def sigterm_handler ( signum , frame ) : logger . info ( u'Got SIGTERM signal. Exiting...' ) exit_process ( )
gracefully exit on a sigterm .