[tor-commits] [arm/master] fix: wasn't shutting down daemons after interrupt

atagar at torproject.org atagar at torproject.org
Fri Jul 1 17:17:27 UTC 2011


commit 796b9c0feb9e325177d1b4e42c1e07c3ee748283
Author: Damian Johnson <atagar at torproject.org>
Date:   Fri Jul 1 08:51:37 2011 -0700

    fix: wasn't shutting down daemons after interrupt
    
    Moving the shutdown of service daemons into finally block so it's done after
    keyboard interrupts (ie, ctrl+c). Otherwise shutting down this way could cause
    occasional stacktraces.
---
 src/cli/controller.py |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/src/cli/controller.py b/src/cli/controller.py
index e771a26..c9ab6e7 100644
--- a/src/cli/controller.py
+++ b/src/cli/controller.py
@@ -503,6 +503,7 @@ def startTorMonitor(startTime):
     curses.wrapper(drawTorMonitor, startTime)
   except KeyboardInterrupt:
     pass # skip printing stack trace in case of keyboard interrupt
+  finally: shutdownDaemons()
 
 def drawTorMonitor(stdscr, startTime):
   """
@@ -602,6 +603,4 @@ def drawTorMonitor(stdscr, startTime):
       for panelImpl in displayPanels:
         isKeystrokeConsumed = panelImpl.handleKey(key)
         if isKeystrokeConsumed: break
-  
-  shutdownDaemons()
 





More information about the tor-commits mailing list