mirror of
https://github.com/jlu5/PyLink.git
synced 2025-03-28 10:31:01 +01:00
parent
fa1ce45bf3
commit
a4dbd8d09f
@ -29,12 +29,13 @@ def _shutdown(irc=None):
|
|||||||
# Disconnect all our networks.
|
# Disconnect all our networks.
|
||||||
remove_network(ircobj)
|
remove_network(ircobj)
|
||||||
|
|
||||||
def sigterm_handler(_signo, _stack_frame):
|
def sigterm_handler(signo, stack_frame):
|
||||||
"""Handles SIGTERM gracefully by shutting down the PyLink daemon."""
|
"""Handles SIGTERM and SIGINT gracefully by shutting down the PyLink daemon."""
|
||||||
log.info("Shutting down on SIGTERM.")
|
log.info("Shutting down on signal %s." % signo)
|
||||||
_shutdown()
|
_shutdown()
|
||||||
|
|
||||||
signal.signal(signal.SIGTERM, sigterm_handler)
|
signal.signal(signal.SIGTERM, sigterm_handler)
|
||||||
|
signal.signal(signal.SIGINT, sigterm_handler)
|
||||||
|
|
||||||
def _rehash():
|
def _rehash():
|
||||||
"""Rehashes the PyLink daemon."""
|
"""Rehashes the PyLink daemon."""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user