commit 37668610f78ac5b29ae399fac24ba70e2a2a643c Author: aagbsn aagbsn@extc.org Date: Mon Aug 15 13:42:14 2011 -0700
fix regarding #3701
https://trac.torproject.org/projects/tor/ticket/3701 bwauthority.py will no longer exit if the child dies with SIGTERM
also modified run_scan.sh to kill -9 --- NetworkScanners/BwAuthority/bwauthority.py | 12 ++++++++++-- NetworkScanners/BwAuthority/run_scan.sh | 2 +- 2 files changed, 11 insertions(+), 3 deletions(-)
diff --git a/NetworkScanners/BwAuthority/bwauthority.py b/NetworkScanners/BwAuthority/bwauthority.py index 9125044..3e626db 100755 --- a/NetworkScanners/BwAuthority/bwauthority.py +++ b/NetworkScanners/BwAuthority/bwauthority.py @@ -28,8 +28,16 @@ def main(argv): plog('WARN', 'Child process recieved SIGKILL, exiting') exit() elif (abs(p.returncode) == SIGTERM): - plog('WARN', 'Child process recieved SIGTERM, exiting') - exit() + #XXX + # see: https://trac.torproject.org/projects/tor/ticket/3701 + # if uncaught exceptions are raised in user-written handlers, TorCtl + # will kill the bwauthority_child process using os.kill() because sys.exit() + # only exits the thread in which the exception is caught. + # quote mikeperry: "we want this thing not do die. that is priority one" + # therefore: we restart the child process and hope for the best :-) + plog('WARN', 'Child process recieved SIGTERM') + #exit() + else: plog('WARN', 'Child process returned %s' % p.returncode)
diff --git a/NetworkScanners/BwAuthority/run_scan.sh b/NetworkScanners/BwAuthority/run_scan.sh index 77a7a9a..b3e1355 100755 --- a/NetworkScanners/BwAuthority/run_scan.sh +++ b/NetworkScanners/BwAuthority/run_scan.sh @@ -12,7 +12,7 @@ for n in `seq $SCANNER_COUNT`; do PIDFILE=./data/scanner.${n}/bwauthority.pid if [ -f $PIDFILE ]; then echo "Killing off scanner $n." - kill `head -1 $PIDFILE` && rm $PIDFILE + kill -9 `head -1 $PIDFILE` && rm $PIDFILE fi done
tor-commits@lists.torproject.org