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,7 +91,6 @@ def restart_services():
if len(parents) < 2: if len(parents) < 2:
log.debug('{} is its own top parent'.format(proc)) log.debug('{} is its own top parent'.format(proc))
parent = proc parent = proc
service_procs.add(proc)
else: else:
log.debug('{} has top parent {}'.format(proc, parents[-2])) log.debug('{} has top parent {}'.format(proc, parents[-2]))
parent = parents[-2] parent = parents[-2]
@ -162,14 +161,14 @@ def restart_services():
if _get_deleted_open_files(proc): if _get_deleted_open_files(proc):
if name in services and not services[name]: 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 recommend_restart = True
continue continue
elif name in services: elif name in services:
policy = _get_service_restart_policy(services[parent.name()]) policy = _get_service_restart_policy(services[parent.name()])
if policy in ('ignore', 'warn'): if policy in ('ignore', 'warn'):
continue continue
log.warning('{} still has deleted files open'.format(proc)) log.warning('{} (parent {}) still has deleted files open'.format(proc, parent))
recommend_restart = True recommend_restart = True
return recommend_restart return recommend_restart