mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Merge pull request #39796 from cachedout/master_shutdown
Stop the process manager when it no longer has processes to manage
This commit is contained in:
commit
1f3619c1e5
1 changed files with 3 additions and 0 deletions
|
@ -385,6 +385,8 @@ class ProcessManager(object):
|
|||
yield gen.sleep(10)
|
||||
else:
|
||||
time.sleep(10)
|
||||
if len(self._process_map) == 0:
|
||||
break
|
||||
# OSError is raised if a signal handler is called (SIGTERM) during os.wait
|
||||
except OSError:
|
||||
break
|
||||
|
@ -396,6 +398,7 @@ class ProcessManager(object):
|
|||
if self._restart_processes is True:
|
||||
for pid, mapping in six.iteritems(self._process_map):
|
||||
if not mapping['Process'].is_alive():
|
||||
log.trace('Process restart of {0}'.format(pid))
|
||||
self.restart_process(pid)
|
||||
|
||||
def kill_children(self, *args, **kwargs):
|
||||
|
|
Loading…
Add table
Reference in a new issue