3
0
mirror of https://github.com/jlu5/PyLink.git synced 2024-11-30 14:49:28 +01:00

control: continue handling SIGUSR1 as rehash for compat with older 2.0 versions

This commit is contained in:
James Lu 2018-01-21 13:35:21 -08:00
parent 44be5910e0
commit e446e0e27b

View File

@ -139,10 +139,11 @@ def rehash():
log.info('Finished reloading PyLink configuration.')
if os.name == 'posix':
# Only register SIGHUP on *nix.
def sighup_handler(_signo, _stack_frame):
"""Handles SIGHUP by rehashing the PyLink daemon."""
log.info("SIGHUP received, reloading config.")
# Only register SIGHUP/SIGUSR1 on *nix.
def _sighup_handler(signo, _stack_frame):
"""Handles SIGHUP/SIGUSR1 by rehashing the PyLink daemon."""
log.info("Signal %s received, reloading config." % signo)
rehash()
signal.signal(signal.SIGHUP, sighup_handler)
signal.signal(signal.SIGHUP, _sighup_handler)
signal.signal(signal.SIGUSR1, _sighup_handler)