Browse Source

[213] The core components to start

They are the sockcreator (present already before), msgq and cfgmgr
Michal 'vorner' Vaner 13 years ago
parent
commit
e5d4874ace

+ 16 - 4
src/bin/bind10/bind10_src.py.in

@@ -248,7 +248,18 @@ class BoB:
         self.__core_components = {
             'sockcreator': {
                 'kind': 'core',
-                'special': 'sockcreator'
+                'special': 'sockcreator',
+                'priority': 200
+            },
+            'msgq': {
+                'kind': 'core',
+                'special': 'msgq',
+                'priority': 199
+            },
+            'cfgmgr': {
+                'kind': 'core',
+                'special': 'cfgmgr',
+                'priority': 198
             }
         }
 
@@ -323,10 +334,11 @@ class BoB:
         self.stop_creator(True)
 
         for pid in self.processes:
-            logger.info(BIND10_KILL_PROCESS, self.processes[pid].name)
-            self.processes[pid].process.kill()
+            logger.info(BIND10_KILL_PROCESS, self.processes[pid].name())
+            os.kill(self.processes[pid].pid(), signal.SIGTERM)
         self.processes = {}
-        self.__component_configurator.shutdown()
+        if self.__component_configurator.running():
+            self.__component_configurator.shutdown()
 
     def read_bind10_config(self):
         """

+ 3 - 0
src/lib/python/isc/bind10/component.py

@@ -347,6 +347,9 @@ class Configurator:
                                                         reverse=True)])
         return plan
 
+    def running(self):
+        return self._running
+
     def _run_plan(self, plan):
         """
         Run a plan, created beforehead by _build_plan.

+ 3 - 0
src/lib/python/isc/bind10/tests/component_test.py

@@ -694,6 +694,7 @@ class ConfiguratorTest(BossUtils, unittest.TestCase):
         # Can't reconfigure nor stop yet
         self.assertRaises(ValueError, configurator.reconfigure, self.__core)
         self.assertRaises(ValueError, configurator.shutdown)
+        self.assertFalse(configurator.running())
         # Start it
         configurator.startup(self.__core)
         self.assertEqual(self.__core_log, self.log)
@@ -701,6 +702,7 @@ class ConfiguratorTest(BossUtils, unittest.TestCase):
             self.assertTrue(core in configurator._components)
         self.assertEqual(self.__core, configurator._old_config)
         self.assertTrue(configurator._running)
+        self.assertTrue(configurator.running())
         # It can't be started twice
         self.assertRaises(ValueError, configurator.startup, self.__core)
 
@@ -727,6 +729,7 @@ class ConfiguratorTest(BossUtils, unittest.TestCase):
         self.assertEqual({}, configurator._components)
         self.assertEqual({}, configurator._old_config)
         self.assertFalse(configurator._running)
+        self.assertFalse(configurator.running())
         self.__check_shutdown_log()
 
         # It can't be stopped twice