openclaw daemon
openclaw daemon 是 Gateway 服务管理命令的遗留别名,与 openclaw gateway 服务子命令等价。新脚本建议直接使用 openclaw gateway。
用法
openclaw daemon status
openclaw daemon install
openclaw daemon start
openclaw daemon stop
openclaw daemon restart
openclaw daemon uninstall子命令说明
| 子命令 | 说明 |
|---|---|
status | 显示服务安装状态并探测 Gateway 健康 |
install | 安装系统服务(launchd / systemd / schtasks) |
uninstall | 卸载服务 |
start | 启动服务 |
stop | 停止服务 |
restart | 重启服务 |
常用选项
status:--url、--token、--password、--timeout、--no-probe、--require-rpc、--deep、--jsoninstall:--port、--runtime <node|bun>、--token、--force、--jsonrestart:--safe、--skip-deferral、--force、--wait <duration>、--json
关键行为
status --deep:扫描系统级服务,检测多余的 gateway 实例,并在插件感知模式下做配置校验restart --safe:等待活跃任务(reply delivery、embedded runs、task runs)排空后再重启restart --safe --skip-deferral:强制立即重启,绕过排空等待(卡住任务时的逃生通道)- SecretRef 管理的 token 在 install 时只做可解析性校验,不会将明文 token 写入服务环境
macOS 注意
若曾用 launchctl setenv 设置过 OPENCLAW_GATEWAY_TOKEN,该值会覆盖配置文件,导致持续 “unauthorized” 错误:
launchctl unsetenv OPENCLAW_GATEWAY_TOKEN