fix: deduplicate sidecars/systemd, block system-critical stops, filter runtime paths
This commit is contained in:
+4
-2
@@ -205,8 +205,9 @@ def discover_nginx(service_ports, service_domain_hints):
|
||||
|
||||
|
||||
def get_nginx_systemd_unit():
|
||||
"""Ищет unit-файл nginx"""
|
||||
"""Ищет unit-файл nginx, возвращает уникальные (deduplicated по пути)"""
|
||||
units = []
|
||||
seen_paths = set()
|
||||
for unit in ("nginx.service", "nginx"):
|
||||
out = run(f"systemctl is-active {unit}", check=False)
|
||||
if out.returncode == 0 or out.stdout.strip() in ("active", "inactive"):
|
||||
@@ -214,7 +215,8 @@ def get_nginx_systemd_unit():
|
||||
try:
|
||||
uout = run(f"systemctl show {unit} -p FragmentPath --value", check=False)
|
||||
path = uout.stdout.strip()
|
||||
if path:
|
||||
if path and path not in seen_paths:
|
||||
seen_paths.add(path)
|
||||
units.append({"unit": unit, "path": path})
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
Reference in New Issue
Block a user