do not re-test ignored processes

This commit is contained in:
Fredrik Eriksson 2024-08-03 07:04:14 +02:00
parent 7cce11022c
commit db865eafe9
Signed by: feffe
GPG Key ID: E6B5580B853D322B

View File

@ -116,7 +116,6 @@ def restart_services():
retest_procs.add(proc)
recommend_restart = False
processes = {}
services = {}
for proc in service_procs:
if not proc:
@ -141,15 +140,17 @@ def restart_services():
sau.helpers.exec_cmd([ '/usr/bin/systemctl', 'daemon-reexec' ])
continue
elif service_name == '@ignore':
log.info(f"Process {proc} ignored by configuration")
retest_procs.discard(proc)
continue
services[proc_name] = service_name
processes[service_name] = [proc]
for service in set([x for x in services.values() if x]):
policy = _get_service_restart_policy(service)
if policy == 'ignore':
log.info('Service "{}" ignored by configuration'.format(service))
[retest_procs.discard(x) for x,y in services.items() if y == service]
continue
elif policy == 'warn':
log.warning('Service "{}" has open deleted files and should be restarted'.format(service))