[tor-commits] [bridgedb/master] Handle KeyboardInterrupts in Main.startup() loop.
isis at torproject.org
isis at torproject.org
Sun Jan 12 06:06:32 UTC 2014
commit f075404fcd6c0209099dda50206716700b125fd9
Author: Isis Lovecruft <isis at torproject.org>
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):
More information about the tor-commits
mailing list