fix: deduplicate sidecars/systemd, block system-critical stops, filter runtime paths
This commit is contained in:
+10
-2
@@ -72,10 +72,12 @@ def find_listeners_on_host(port):
|
||||
def find_sidecar_processes(cid, container_ports):
|
||||
"""
|
||||
Ищет sidecar-процессы на хосте, к которым контейнер стучится через loopback.
|
||||
Дедуплицирует по (host_process, container_port_target).
|
||||
"""
|
||||
info("Ищем loopback-соединения контейнера (sidecar / proxy / WARP) ...")
|
||||
conns = get_container_host_connections(cid)
|
||||
sidecars = []
|
||||
seen = set()
|
||||
|
||||
for c in conns:
|
||||
local = c.get("local", "")
|
||||
@@ -87,11 +89,16 @@ def find_sidecar_processes(cid, container_ports):
|
||||
listeners = find_listeners_on_host(port)
|
||||
if listeners:
|
||||
for l in listeners:
|
||||
info(f" Контейнер подключается к {local} → процесс на хосте: {l.get('process', '?')} (pid={l.get('pid', '?')})")
|
||||
proc = l.get("process", "?")
|
||||
key = (proc, port)
|
||||
if key in seen:
|
||||
continue
|
||||
seen.add(key)
|
||||
info(f" Контейнер подключается к {local} → процесс на хосте: {proc} (pid={l.get('pid', '?')})")
|
||||
sidecars.append({
|
||||
"type": "loopback_listener",
|
||||
"container_port_target": port,
|
||||
"host_process": l.get("process"),
|
||||
"host_process": proc,
|
||||
"host_pid": l.get("pid"),
|
||||
"method": "ss_lsof",
|
||||
})
|
||||
@@ -176,6 +183,7 @@ def gather_host_network_info():
|
||||
def find_systemd_units_related(procs):
|
||||
"""
|
||||
Ищет systemd unit-файлы для процессов (sidecar и других).
|
||||
Дедуплицирует по имени unit.
|
||||
"""
|
||||
units = []
|
||||
seen = set()
|
||||
|
||||
Reference in New Issue
Block a user