summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Dold <florian.dold@gmail.com>2018-01-22 00:15:03 +0100
committerFlorian Dold <florian.dold@gmail.com>2018-01-22 00:15:03 +0100
commit831d35d8dff1e08a7e030a1a3515dfaec7aae711 (patch)
treebc5648c9ade008d55f2a74ea5f93cd3dafcfb879
parent35baa0a2c6ff978995c963bad770a24aced082da (diff)
downloaddeployment-831d35d8dff1e08a7e030a1a3515dfaec7aae711.tar.gz
deployment-831d35d8dff1e08a7e030a1a3515dfaec7aae711.tar.bz2
deployment-831d35d8dff1e08a7e030a1a3515dfaec7aae711.zip
catch all signals in log adapter
-rwxr-xr-xbin/taler-log-adapter6
1 files changed, 4 insertions, 2 deletions
diff --git a/bin/taler-log-adapter b/bin/taler-log-adapter
index 51d2df6..07321fa 100755
--- a/bin/taler-log-adapter
+++ b/bin/taler-log-adapter
@@ -29,7 +29,7 @@ import time
def handler(signum, frame):
if p:
- os.kill(p.pid, signal.SIGINT)
+ os.kill(p.pid, signum)
else:
sys.exit(-1)
@@ -43,7 +43,9 @@ if len(sys.argv) < 3:
sys.exit(-1)
p = None
-signal.signal(signal.SIGINT, handler)
+catchable_sigs = set(signal.Signals) - {signal.SIGKILL, signal.SIGSTOP}
+for sig in catchable_sigs:
+ signal.signal(sig, handler)
p = Popen(sys.argv[2:], stderr=PIPE, shell=False)
log = sys.argv[1]