From fd77dc579e40a5c910d47f333199a076b7fe17d5 Mon Sep 17 00:00:00 2001 From: Dan Date: Tue, 31 Oct 2017 22:10:00 -0700 Subject: [PATCH] Pass through several more Unix signals that Borg happens to consume. --- NEWS | 2 +- borgmatic/signals.py | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/NEWS b/NEWS index ba87af78..49afddec 100644 --- a/NEWS +++ b/NEWS @@ -1,5 +1,5 @@ 1.1.10.dev0 - * Passing the Unix SIGTERM signal through to child processes like Borg. This means that Borg now + * Passing several Unix signals through to child processes like Borg. This means that Borg now properly shuts down if borgmatic is terminated (e.g. due to a system suspend). 1.1.9 diff --git a/borgmatic/signals.py b/borgmatic/signals.py index d500350c..41d913dc 100644 --- a/borgmatic/signals.py +++ b/borgmatic/signals.py @@ -12,6 +12,7 @@ def _handle_signal(signal_number, frame): # pragma: no cover def configure_signals(): # pragma: no cover ''' Configure borgmatic's signal handlers to pass relevant signals through to any child processes - like Borg. + like Borg. No that SIGINT gets passed through already even without these changes. ''' - signal.signal(signal.SIGTERM, _handle_signal) + for signal_number in (signal.SIGHUP, signal.SIGTERM, signal.SIGUSR1, signal.SIGUSR2): + signal.signal(signal_number, _handle_signal)