Преглед на файлове

Pass through several more Unix signals that Borg happens to consume.

Dan преди 7 години
родител
ревизия
fd77dc579e
променени са 2 файла, в които са добавени 4 реда и са изтрити 3 реда
  1. 1 1
      NEWS
  2. 3 2
      borgmatic/signals.py

+ 1 - 1
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

+ 3 - 2
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)