Browse Source

[213] Post-shutdown killing in boss

When the shutdown doesn't work.
Michal 'vorner' Vaner 13 years ago
parent
commit
b458fc09d6
1 changed files with 8 additions and 9 deletions
  1. 8 9
      src/bin/bind10/bind10_src.py.in

+ 8 - 9
src/bin/bind10/bind10_src.py.in

@@ -637,12 +637,11 @@ class BoB:
         self.reap_children()
         # next try sending a SIGTERM
         processes_to_stop = list(self.processes.values())
-        for proc_info in processes_to_stop:
-            logger.info(BIND10_SEND_SIGTERM, proc_info.name,
-                        proc_info.pid)
+        for component in processes_to_stop:
+            logger.info(BIND10_SEND_SIGTERM, component.name(),
+                        component.pid())
             try:
-                # FIXME: This won't work. We replaced them with something else
-                proc_info.process.terminate()
+                os.kill(component.pid(), signal.SIGTERM)
             except OSError:
                 # ignore these (usually ESRCH because the child
                 # finally exited)
@@ -653,11 +652,11 @@ class BoB:
             time.sleep(0.1)
             self.reap_children()
             processes_to_stop = list(self.processes.values())
-            for proc_info in processes_to_stop:
-                logger.info(BIND10_SEND_SIGKILL, proc_info.name,
-                            proc_info.pid)
+            for component in processes_to_stop:
+                logger.info(BIND10_SEND_SIGKILL, component.name(),
+                            component.pid())
                 try:
-                    proc_info.process.kill()
+                    os.kill(component.pid(), signal.SIGKILL)
                 except OSError:
                     # ignore these (usually ESRCH because the child
                     # finally exited)