From db865eafe9a48152dcd8c06f6bf25efff42053e0 Mon Sep 17 00:00:00 2001 From: Fredrik Eriksson Date: Sat, 3 Aug 2024 07:04:14 +0200 Subject: [PATCH] do not re-test ignored processes --- sau/services.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sau/services.py b/sau/services.py index 121e8d3..43f79a4 100644 --- a/sau/services.py +++ b/sau/services.py @@ -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))