Gateway Watchdog
v1.0.0Production-grade bash watchdog for the OpenClaw gateway. Runs via launchd every 5 minutes. Handles boot grace periods, progressive retry with backoff, port-l...
详细分析 ▾
运行时依赖
版本
Initial release of gateway-watchdog for OpenClaw gateway. - Production-ready bash watchdog designed for maximum reliability and false positive prevention. - Five defensive layers: HTTP check, boot grace period, port-level fallback, progressive retry with backoff, and restart cooldown. - Runs automatically via launchd every 5 minutes on macOS. - Prevents restart loops and ensures the gateway remains available. - Logs written to `~/.openclaw/logs/watchdog.log`.
安装命令 点击复制
技能文档
Keeps the OpenClaw gateway alive without killing it during startup. Five defensive layers prevent false restarts and restart loops.
How It Works
- HTTP check — pings
http://127.0.0.1:18789; exits immediately if the gateway responds - Boot grace — if the process is <180s old, waits without acting (avoids killing a booting gateway)
- Port check — if the port is bound but HTTP is slow, waits up to 15s for recovery
- Progressive retry — 3 retries at 15s / 30s / 45s intervals
- Cooldown — enforces a 10-minute gap between restarts to prevent loops
Logs go to ~/.openclaw/logs/watchdog.log.
Setup (macOS launchd)
Create ~/Library/LaunchAgents/com.openclaw.gateway-watchdog.plist:
Label
com.openclaw.gateway-watchdog
ProgramArguments
/bin/bash
/path/to/skills/gateway-watchdog/scripts/gateway-watchdog.sh
StartInterval
300
RunAtLoad
Then load it:
launchctl load ~/Library/LaunchAgents/com.openclaw.gateway-watchdog.plist
Usage (manual)
bash scripts/gateway-watchdog.sh
Requirements
- macOS (uses
launchctl,lsof,date -j) curlin PATH- OpenClaw gateway running under
launchdasai.openclaw.gateway
免费技能或插件可能存在安全风险,如需更匹配、更安全的方案,建议联系付费定制