[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[or-cvs] r20022: {torflow} Fix PidFile usage a little. Also, implement a form of ghetto (torflow/trunk/NetworkScanners/BwAuthority)



Author: mikeperry
Date: 2009-07-14 21:47:04 -0400 (Tue, 14 Jul 2009)
New Revision: 20022

Modified:
   torflow/trunk/NetworkScanners/BwAuthority/run_scan.sh
Log:

Fix PidFile usage a little. Also, implement a form of
ghetto-resume so we don't always have to fully bootstrap and
wait for results. We may end up doing a lot of work over
again still with this method, though, because it just keeps
the results and starts from the beginning.



Modified: torflow/trunk/NetworkScanners/BwAuthority/run_scan.sh
===================================================================
--- torflow/trunk/NetworkScanners/BwAuthority/run_scan.sh	2009-07-15 00:31:57 UTC (rev 20021)
+++ torflow/trunk/NetworkScanners/BwAuthority/run_scan.sh	2009-07-15 01:47:04 UTC (rev 20022)
@@ -9,22 +9,24 @@
 TOR_EXE=../../../tor.git/src/or/tor
 PYTHONPATH=../../../SQLAlchemy-0.5.5/lib:../../../Elixir-0.6.1/
 
-# NOTE: You may want to remove this line if these are not the only
-# tors run by this user:
 killall bwauthority.py
 
 for i in data/scanner.*
 do
   if [ -f "$i/tor.pid" ]; then
     PID=`cat $i/tor.pid`
-    kill $PID && sleep 2 && kill -9 $PID
-    rm "$i/tor.pid"
+    kill $PID
   fi
 done
 
+sleep 5
+
+# FIXME: We resume in a ghetto way by saving the bws-*done* files.
+# A more accurate resume could be implemented in bwauthority.py
 for i in data/scanner.*
 do
-  rm $i/scan-data/*
+  find $i/scan-data/ -depth -type f -print | egrep -v -- "-done-|\/.svn" | xargs -P 1024 rm
+  #rm $i/scan-data/*
 done
 
 $TOR_EXE -f ./data/scanner.1/torrc &