summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Sulfrian <alexander@sulfrian.net>2014-10-25 01:30:36 +0200
committerAlexander Sulfrian <alexander@sulfrian.net>2014-10-25 01:36:50 +0200
commit477841f0508b6a750f7899622729a0c9fc40f07e (patch)
treeea534bf146c0eabc2478d823fa0afde6d84cac23
parent9678b216178b3470bb5e1b5894ae36371df84780 (diff)
downloadbcfg2-477841f0508b6a750f7899622729a0c9fc40f07e.tar.gz
bcfg2-477841f0508b6a750f7899622729a0c9fc40f07e.tar.bz2
bcfg2-477841f0508b6a750f7899622729a0c9fc40f07e.zip
Server/Core: also shutdown on exceptions during fam blocking
Previously the server got stuck, if a keyboard interrupt occured during block_for_fam_events. The KeyboardInterrupt exception was only handled in the executable and it does not call shutdown for the Core. So the running fam thread does not get killed and the main thread waits for it.
-rw-r--r--src/lib/Bcfg2/Server/Core.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/lib/Bcfg2/Server/Core.py b/src/lib/Bcfg2/Server/Core.py
index f60b68f45..6dfe4df1f 100644
--- a/src/lib/Bcfg2/Server/Core.py
+++ b/src/lib/Bcfg2/Server/Core.py
@@ -847,15 +847,15 @@ class BaseCore(object):
for plug in self.plugins_by_type(Threaded):
plug.start_threads()
+
+ if self.debug_flag:
+ self.set_debug(None, self.debug_flag)
+ self.block_for_fam_events()
+ self._block()
except:
self.shutdown()
raise
- if self.debug_flag:
- self.set_debug(None, self.debug_flag)
- self.block_for_fam_events()
- self._block()
-
def _daemonize(self):
""" Daemonize the server and write the pidfile. This must be
overridden by a core implementation. """