another attempt to fix restarts

This commit is contained in:
Fredrik Eriksson 2019-06-22 13:35:23 +02:00
parent 7f84e141c8
commit 7833254c33
No known key found for this signature in database
GPG Key ID: 8825C73A0FD1502A

View File

@ -91,11 +91,10 @@ def restart_services():
if len(parents) < 2:
log.debug('{} is its own top parent'.format(proc))
parent = proc
service_procs.add(proc)
else:
log.debug('{} has top parent {}'.format(proc, parents[-2]))
parent = parents[-2]
service_procs.add(parent)
service_procs.add(parent)
retest_procs[proc] = parent
processes = {}
@ -162,14 +161,14 @@ def restart_services():
if _get_deleted_open_files(proc):
if name in services and not services[name]:
log.warning('{} does not belong to a service and could not be restarted'.format(proc))
log.warning('{} (parent {}) does not belong to a service and could not be restarted'.format(proc, parent))
recommend_restart = True
continue
elif name in services:
policy = _get_service_restart_policy(services[parent.name()])
if policy in ('ignore', 'warn'):
continue
log.warning('{} still has deleted files open'.format(proc))
log.warning('{} (parent {}) still has deleted files open'.format(proc, parent))
recommend_restart = True
return recommend_restart