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

[tor-commits] [bridgedb/master] Handle KeyboardInterrupts in Main.startup() loop.



commit f075404fcd6c0209099dda50206716700b125fd9
Author: Isis Lovecruft <isis@xxxxxxxxxxxxxx>
Date:   Fri Nov 15 15:19:35 2013 +0000

    Handle KeyboardInterrupts in Main.startup() loop.
---
 lib/bridgedb/Main.py |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/lib/bridgedb/Main.py b/lib/bridgedb/Main.py
index f62b54d..ad51631 100644
--- a/lib/bridgedb/Main.py
+++ b/lib/bridgedb/Main.py
@@ -526,10 +526,14 @@ def startup(options, rundir, configFile):
     try:
         logging.info("Starting reactors.")
         reactor.run()
+    except KeyboardInterrupt:
+        logging.fatal("Received keyboard interrupt. Shutting down...")
     finally:
+        logging.info("Closing databases...")
         db.close()
         if config.PIDFILE:
             os.unlink(config.PIDFILE)
+        logging.info("Exiting...")
         sys.exit()
 
 def runSubcommand(options, config):



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits