-
-
Notifications
You must be signed in to change notification settings - Fork 52.7k
Open
Labels
staleMarked as stale due to inactivityMarked as stale due to inactivity
Description
问题描述
在 macOS 上使用 launchd 部署 OpenClaw Gateway 时,如果服务每 5-10 分钟自动退出,launchd 会误判为崩溃循环(crash loop),并在连续 4 次快速退出后自动卸载服务。
环境
- macOS
- OpenClaw 版本:2026.2.15
- 部署方式:launchd (LaunchAgent)
复现步骤
- 使用
openclaw gateway start启动服务 - 服务配置了
KeepAlive: true - 服务因为某种原因每 5-10 分钟退出一次
- 观察 launchd 状态:服务已被卸载
期望行为
launchd 应该正确区分"正常退出后重启"和"崩溃循环",不应该因为正常退出而卸载服务。
建议的修复方案
在生成的 LaunchAgent plist 文件中添加以下键:
ThrottleInterval(建议值: 60):服务退出后等待秒数才允许重启StartInterval(建议值: 60):定期检查重启间隔ExitTimeOut(建议值: 60):等待服务优雅退出的时间
示例:
<key>ThrottleInterval</key>
<integer>60</integer>
<key>StartInterval</key>
<integer>60</integer>
<key>ExitTimeOut</key>
<integer>60</integer>这样即使服务频繁退出,只要退出间隔大于 ThrottleInterval,就不会被误判为崩溃循环。
临时解决方案
手动编辑 plist 文件添加上述参数,但每次运行 openclaw gateway start 会被覆盖。
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
staleMarked as stale due to inactivityMarked as stale due to inactivity