Cherry-pick 63c6080: fix: clean stale gateway PIDs before restart#1163
Merged
alexey-pelykh merged 1 commit intomainfrom Mar 13, 2026
Merged
Cherry-pick 63c6080: fix: clean stale gateway PIDs before restart#1163alexey-pelykh merged 1 commit intomainfrom
alexey-pelykh merged 1 commit intomainfrom
Conversation
…nchctl/systemctl When the /restart command runs inside an embedded agent process (no SIGUSR1 listener), it falls through to triggerOpenClawRestart() which calls launchctl kickstart -k directly — bypassing the pre-restart port cleanup added in openclaw#27013. If the gateway was started via TUI/CLI, the orphaned process still holds the port and the new launchd instance crash-loops. Add synchronous stale-PID detection (lsof) and termination (SIGTERM→SIGKILL) inside triggerOpenClawRestart() itself, so every caller — including the embedded agent /restart path — gets port cleanup before the service manager restart command fires. Closes openclaw#26736 Made-with: Cursor (cherry picked from commit 63c6080)
This was referenced Mar 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Cherry-pick from upstream
Upstream commit: 63c6080
Author: SidQin-cyber
Tier: AUTO-PICK
Resolved merge conflict: upstream added new functions (findGatewayPidsOnPortSync, terminateStaleProcessesSync, cleanStaleGatewayProcessesSync) before the function declaration that the fork had renamed. Kept fork's
triggerRemoteClawRestartname, rebrandedopenclaw→remoteclawin process name matching.Depends on #1162