← Back to library

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
  1. Upgrade to a build containing PR #13813.
  2. Run gateway install flow and let installer persist generated token into config/service env.
  3. Restart service and observe whether previous rapid restart loop disappears.
  4. Use status/logs to confirm the service stays healthy for several minutes.
Commands
openclaw gateway install
openclaw gateway restart
openclaw gateway status
openclaw logs --local-time
Verify

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 ↗
Visit original post