mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-16 23:52:40 -06:00
6fb3aae404
`openclaw gateway stop` resolved the unmanaged fallback port from config and discovered pids through lsof only. On hosts without lsof, and whenever the gateway runs on a port other than the configured one, discovery came back empty and the command reported `Gateway service disabled.` with `ok:true` and exit 0 while the gateway kept serving. The gateway lock already holds the verified owner pid and port. Restart learned to read the lock port in #105241 to keep an unmanaged restart honest when the configured port drifts; stop's fallback never did. Read the lock identity once in the not-loaded fallback, use its port for discovery, and signal its owner when no listener is found. Verified listeners still win when lsof is available. Signalling still goes through `signalVerifiedGatewayPidSync`, which re-reads argv immediately before SIGTERM, and lock identities are only returned after a liveness and start-time or argv check, so dead, recycled, port-less and non-gateway lock owners are refused and the command stays `not-loaded`. Closes #72948