fix: watchdog revival — port 5807 in registry, skip remote/self-managed services, add to start.bat

- service_registry: xmpp_bot port 5802 -> 5807 (matches xmpp_agent_core), fix health_url/log
- xmpp_watchdog: skip services without script or pid_file (dashboard self-managed, gateway_* remote) — previously crashed on open(None)
- start.bat: launch watchdog after xxm bot so crash auto-recovery runs on boot
This commit is contained in:
hmo
2026-08-05 09:57:51 +08:00
parent afcce956f0
commit 1dd3f9aad5
3 changed files with 14 additions and 3 deletions
+3 -3
View File
@@ -18,11 +18,11 @@ SERVICES = [
"args": ["--agent", "xxm"],
"workdir": BASE,
"pid_file": os.path.join(TEMP, ".xmpp_bot.pid"),
"port": 5802,
"health_url": "http://127.0.0.1:5802/health",
"port": 5807, # xxm 的 HTTP bridge 已从 5802 迁移到 5807(见 xmpp_agent_core.py AGENTS.xxm.http_port
"health_url": "http://127.0.0.1:5807/health",
"accept_401": False, # /health 现在返回 200(免认证)
"depends_on": [],
"log_files": lambda: [os.path.join(GATEWAY_DIR, "logs", "xmpp_bot.log"),
"log_files": lambda: [os.path.join(GATEWAY_DIR, "logs", "xmpp_xxm.log"),
os.path.join(GATEWAY_DIR, "logs", "bridge.log")],
"description": "XMPP Bot (xxm@yoin.fun)",
},
+7
View File
@@ -28,6 +28,13 @@ from service_registry import SERVICES as _SR
SERVICES = {}
for svc in _SR:
name = svc["name"]
# watchdog 只管理「本机可拉起」的进程服务:
# - script 为 None → 远程服务(gateway_mohe/zhiwei),由 246 crontab/systemd 管
# - pid_file 为 None → dashboard,自管进程
# 否则 start_service 会 open(None) 崩溃,且无 pid_file 无法追踪。
if not svc.get("script") or not svc.get("pid_file"):
print(f"[watchdog] skip {name}: remote/self-managed service", flush=True)
continue
SERVICES[name] = {
"script": svc["script"],
"args": svc["args"],