Skip to content

Commit

Permalink
Ignore sighup when daemonized
Browse files Browse the repository at this point in the history
It seems like systemd sends this as well as SIGTERM, so make sure to
ignore it so we shut down cleanly.
  • Loading branch information
jon-turney committed Apr 23, 2024
1 parent 3a18bba commit f1ccc90
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions calm/calm.py
Original file line number Diff line number Diff line change
Expand Up @@ -740,8 +740,12 @@ def sigterm(signum, frame):
running = False
raise InterruptedError

def sighup(signum, frame):
logging.debug("SIGHUP")

context.signal_map = {
signal.SIGTERM: sigterm,
signal.SIGHUP: sighup,
}

with context:
Expand Down

0 comments on commit f1ccc90

Please sign in to comment.