Bug Description
On macOS, the OpenClaw gateway service gets terminated (SIGTERM) when the user session transitions to the login screen, even when sleep is disabled. The LaunchAgent generated by openclaw gateway install is missing the ProcessType=Background key, causing macOS to kill the process for "efficiency" reasons.
Observed Behavior
- Gateway receives
SIGTERM when screen goes to login screen (not sleep)
launchctl print gui/$UID/ai.openclaw.gateway shows immediate reason = inefficient
- Gateway restarts via KeepAlive, but this causes a service interruption
Root Cause
macOS applies aggressive power management to user processes. Without ProcessType=Background, macOS treats the node process as a foreground application and may terminate it during session transitions when it determines the process is using resources "inefficiently."
Fix
Add <key>ProcessType</key><string>Background</string> to the LaunchAgent plist template. This tells macOS that this is a legitimate background daemon that should not be killed for efficiency reasons.
Current plist (missing):
<key>Umask</key>
<integer>63</integer>
<key>ProgramArguments</key>
Fixed plist:
<key>Umask</key>
<integer>63</integer>
<key>ProcessType</key>
<string>Background</string>
<key>ProgramArguments</key>
Environment
- macOS Sequoia (15.x)
- OpenClaw v2026.3.2
- Installed via
openclaw gateway install
Workaround
Manually add ProcessType=Background to the plist and reload:
# Backup
cp ~/Library/LaunchAgents/ai.openclaw.gateway.plist ~/Library/LaunchAgents/ai.openclaw.gateway.plist.backup
# Edit plist to add ProcessType=Background
# Then reload
launchctl bootout gui/$(id -u)/ai.openclaw.gateway
launchctl bootstrap gui/$(id -u) ~/Library/LaunchAgents/ai.openclaw.gateway.plist
References
Bug Description
On macOS, the OpenClaw gateway service gets terminated (SIGTERM) when the user session transitions to the login screen, even when sleep is disabled. The LaunchAgent generated by
openclaw gateway installis missing theProcessType=Backgroundkey, causing macOS to kill the process for "efficiency" reasons.Observed Behavior
SIGTERMwhen screen goes to login screen (not sleep)launchctl print gui/$UID/ai.openclaw.gatewayshowsimmediate reason = inefficientRoot Cause
macOS applies aggressive power management to user processes. Without
ProcessType=Background, macOS treats the node process as a foreground application and may terminate it during session transitions when it determines the process is using resources "inefficiently."Fix
Add
<key>ProcessType</key><string>Background</string>to the LaunchAgent plist template. This tells macOS that this is a legitimate background daemon that should not be killed for efficiency reasons.Current plist (missing):
Fixed plist:
Environment
openclaw gateway installWorkaround
Manually add
ProcessType=Backgroundto the plist and reload:References
BackgroundProcessType is designed for daemon-like services that run continuously