[tor-commits] [torflow/master] bwauthority parent should exit when	child is killed
    mikeperry at torproject.org 
    mikeperry at torproject.org
       
    Fri Jun 24 19:33:54 UTC 2011
    
    
  
commit 0e32c07900b8722d67b338b00fd0c79d746b16a3
Author: aagbsn <aagbsn at extc.org>
Date:   Thu Jun 23 11:39:58 2011 -0700
    bwauthority parent should exit when child is killed
---
 NetworkScanners/BwAuthority/bwauthority.py |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)
diff --git a/NetworkScanners/BwAuthority/bwauthority.py b/NetworkScanners/BwAuthority/bwauthority.py
index 12eeab0..9125044 100755
--- a/NetworkScanners/BwAuthority/bwauthority.py
+++ b/NetworkScanners/BwAuthority/bwauthority.py
@@ -5,7 +5,7 @@ from sys import exit
 from subprocess import Popen
 path.append("../../")
 from TorCtl.TorUtil import plog as plog
-from signal import signal, SIGTERM
+from signal import signal, SIGTERM, SIGKILL
 
 
 # exit code to indicate scan completion
@@ -24,6 +24,12 @@ def main(argv):
     elif (p.returncode == STOP_PCT_REACHED):
       plog('INFO', 'restarting from slice 0')
       slice_num = 0
+    elif (abs(p.returncode) == SIGKILL):
+      plog('WARN', 'Child process recieved SIGKILL, exiting')
+      exit()
+    elif (abs(p.returncode) == SIGTERM):
+      plog('WARN', 'Child process recieved SIGTERM, exiting')
+      exit()
     else:
       plog('WARN', 'Child process returned %s' % p.returncode)
 
    
    
More information about the tor-commits
mailing list