Final check for running procs (#35292)

* Final check for running procs

This does a final check to kill any running procs that are lingering.

* Lint
This commit is contained in:
Mike Place 2016-08-09 23:48:06 +09:00 committed by Nicole Thomas
parent 15d088c15f
commit a3e29c8274

View File

@ -524,7 +524,12 @@ class SaltDaemonScriptBase(SaltScriptBase, ShellTestCase):
except psutil.NoSuchProcess:
children.remove(child)
if children:
psutil.wait_procs(children, timeout=5)
try:
# If we *still* have children, go ahead and attempt to use os.kill() to destroy them
psutil.wait_procs(children, timeout=5, callback=lambda nukeem: [os.kill(child.pid, signal.SIGKILL) for child in children])
except Exception:
pass
log.info('%s %s DAEMON terminated', self.display_name, self.__class__.__name__)
def wait_until_running(self, timeout=None):