Bug
After a SIGUSR1-based gateway restart (triggered by config.patch, gateway restart, or openclaw update), the launchd service frequently becomes unloaded. Subsequent openclaw gateway restart or openclaw gateway stop && openclaw gateway start commands fail with "service not loaded."
Root Cause (suspected)
The gateway restart sends SIGUSR1, causing the process to exit and re-launch. When multiple restarts happen in quick succession (e.g. several config.patch calls), launchd interprets the rapid exits as a crash loop and silently unloads the service via its built-in throttling. Once unloaded, no restart commands work because launchd no longer knows about the service.
Reproduction
- Run several
config.patch calls in a row (or multiple openclaw gateway restart)
- After 2-3 restarts, run
openclaw gateway restart → fails with "service not loaded"
launchctl list | grep openclaw shows no entry
Workaround
openclaw gateway install && openclaw gateway restart
gateway install rewrites the plist and re-registers it with launchctl load/launchctl bootstrap, which always fixes it.
Expected Behavior
- SIGUSR1 restarts should not cause launchd to unload the service
openclaw update should automatically re-register the launchd service (run gateway install internally)
- Ideally, the restart mechanism should handle launchd's crash-loop throttling (e.g. add a small delay, or use a different restart approach)
Environment
- OS: macOS 15 (Sequoia), Apple Silicon
- OpenClaw: 2026.2.9
- Node: v25.5.0
- Plist:
~/Library/LaunchAgents/ai.openclaw.gateway.plist with KeepAlive: true
Bug
After a SIGUSR1-based gateway restart (triggered by
config.patch,gateway restart, oropenclaw update), the launchd service frequently becomes unloaded. Subsequentopenclaw gateway restartoropenclaw gateway stop && openclaw gateway startcommands fail with "service not loaded."Root Cause (suspected)
The gateway restart sends SIGUSR1, causing the process to exit and re-launch. When multiple restarts happen in quick succession (e.g. several
config.patchcalls), launchd interprets the rapid exits as a crash loop and silently unloads the service via its built-in throttling. Once unloaded, no restart commands work because launchd no longer knows about the service.Reproduction
config.patchcalls in a row (or multipleopenclaw gateway restart)openclaw gateway restart→ fails with "service not loaded"launchctl list | grep openclawshows no entryWorkaround
openclaw gateway install && openclaw gateway restartgateway installrewrites the plist and re-registers it withlaunchctl load/launchctl bootstrap, which always fixes it.Expected Behavior
openclaw updateshould automatically re-register the launchd service (rungateway installinternally)Environment
~/Library/LaunchAgents/ai.openclaw.gateway.plistwithKeepAlive: true