Implement hup for log rotation

This function was long-existent, but never used; implement it.
This commit is contained in:
2019-07-10 22:20:24 -04:00
parent 58f4222ee7
commit ac36870a86
2 changed files with 7 additions and 1 deletions

View File

@ -567,10 +567,16 @@ def cleanup():
def term(signum='', frame=''):
cleanup()
# Hangup (logrotate) function
def hup(signum='', frame=''):
if config['file_logging']:
logger.hup()
# Handle signals gracefully
signal.signal(signal.SIGTERM, term)
signal.signal(signal.SIGINT, term)
signal.signal(signal.SIGQUIT, term)
signal.signal(signal.SIGHUP, hup)
###############################################################################
# PHASE 6 - Prepare host in Zookeeper