合并外部维护版本并同步自动每日功能

This commit is contained in:
2026-09-28 13:55:07 +08:00
parent 2d81615f78
commit 9040bcb5e5
59 changed files with 3176 additions and 179 deletions
+31
View File
@@ -0,0 +1,31 @@
import datetime
import sys
import psutil
targets = []
for p in psutil.process_iter(["name", "cmdline"]):
try:
cmd = " ".join(p.info["cmdline"] or [])
except (psutil.NoSuchProcess, psutil.AccessDenied):
continue
if "main.py" in cmd and "--role" in cmd:
targets.append(p)
for p in targets:
try:
parent = p.parent()
print(
p.pid,
p.name(),
"started",
datetime.datetime.fromtimestamp(p.create_time()).strftime("%m-%d %H:%M:%S"),
"parent",
parent.pid if parent else None,
parent.name() if parent else "",
)
except psutil.NoSuchProcess:
print(p.pid, "exited")
if not targets:
print("NO_SERVICE_PROCESS")