macOS launchd restart-loop fix: auto-generate gateway token during install
Scenario: service install under token auth can enter restart loop when env token is missing. Reinstall/upgrade with token autogen and verify plist + runtime token alignment.
GITHUBDiscovered 2026-02-14Author @cathrynlavery
Prerequisites
- You are deploying OpenClaw as a macOS launchd service with token auth.
- You can run gateway install/restart commands with service-level permissions.
Steps
- Upgrade to a build containing PR #13813.
- Run gateway install flow and let installer persist generated token into config/service env.
- Restart service and observe whether previous rapid restart loop disappears.
- Use status/logs to confirm the service stays healthy for several minutes.
Commands
openclaw gateway installopenclaw gateway restartopenclaw gateway statusopenclaw logs --local-timeVerify
Gateway remains up without launchd retry storm, and auth token-based requests pass normally.
Caveats
- If you manually pin token in external secret manager, reconcile to avoid token mismatch after reinstall(需验证).
- This specifically targets launchd env inheritance edge cases; other crash loops need separate diagnosis.
Source attribution
This tip is aggregated from community/public sources and preserved with attribution.
Open original source ↗