-
-
Notifications
You must be signed in to change notification settings - Fork 69k
Bug: gateway restart fails after unload due to incorrect launchctl command sequence on macOS #20030
Copy link
Copy link
Closed
Labels
staleMarked as stale due to inactivityMarked as stale due to inactivity
Description
Bug Description
openclaw gateway restart fails to restart the gateway on macOS. The service is stopped but never restarted.
Error Log
[tools] exec failed: Stopped LaunchAgent: gui/501/ai.openclaw.gateway
Gateway start failed: Error: launchctl kickstart failed:
Command exited with code 1
Root Cause
The restart logic uses an incorrect launchctl command sequence:
launchctl bootout(unload) — ✅ succeeds, service is stoppedlaunchctl kickstart— ❌ fails, service not found
After bootout/unload, the service is removed from launchd's registry. kickstart can only start services that are already registered in launchd, so it fails with "Could not find service".
Expected Fix
Replace kickstart with load/bootstrap after unloading:
# Current (broken)
launchctl bootout gui/501/ai.openclaw.gateway
launchctl kickstart gui/501/ai.openclaw.gateway # fails - service not registered
# Correct
launchctl unload ~/Library/LaunchAgents/ai.openclaw.gateway.plist
launchctl load ~/Library/LaunchAgents/ai.openclaw.gateway.plist # re-registers and startsSteps to Reproduce
- Run
openclaw gateway restarton macOS - Gateway stops but does not restart
launchctl list | grep openclawshows no service
Environment
- macOS Darwin 24.6.0
- openclaw version: 2026.2.14
- LaunchAgent:
gui/501/ai.openclaw.gateway
Workaround
Manually restart with:
launchctl unload ~/Library/LaunchAgents/ai.openclaw.gateway.plist && launchctl load ~/Library/LaunchAgents/ai.openclaw.gateway.plistReactions are currently unavailable
Metadata
Metadata
Assignees
Labels
staleMarked as stale due to inactivityMarked as stale due to inactivity
Type
Fields
Give feedbackNo fields configured for issues without a type.