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:
@@ -14,6 +14,10 @@ echo [2/3] xxm Bot...
|
||||
start /b "" /D "D:\F\NewI\opencode\daily-workspace\projects\AgentsMeeting" "C:\Users\hmo\AppData\Local\Programs\Python\Python310\python.exe" xmpp_agent_core.py --agent xxm
|
||||
timeout /t 10 /nobreak >nul
|
||||
|
||||
echo [2.5/3] Watchdog (auto-restart guard)...
|
||||
start /b "" /D "D:\F\NewI\opencode\daily-workspace\projects\AgentsMeeting\gateway\scripts" "C:\Users\hmo\AppData\Local\Programs\Python\Python310\python.exe" xmpp_watchdog.py
|
||||
timeout /t 3 /nobreak >nul
|
||||
|
||||
echo [3/3] EasyTier...
|
||||
curl -s -X POST http://127.0.0.1:5807/easytier -H "Content-Type: application/json" -H "X-Api-Key: xxm_bridge_8f3a2c" -d "{\"action\":\"start\"}" >nul
|
||||
|
||||
|
||||
@@ -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)",
|
||||
},
|
||||
|
||||
@@ -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"],
|
||||
|
||||
Reference in New Issue
Block a user