-
-
Notifications
You must be signed in to change notification settings - Fork 79.2k
Bug: openclaw gateway restart and openclaw status do not detect system-level systemd service
#87577
Copy link
Copy link
Closed
Labels
P2Normal backlog priority with limited blast radius.Normal backlog priority with limited blast radius.clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.ClawSweeper found a clear likely implementation shape for this issue.clawsweeper:queueable-fixClawSweeper marked this issue as an existing queue_fix_pr work candidate.ClawSweeper marked this issue as an existing queue_fix_pr work candidate.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.impact:otherThis issue has meaningful maintainer-visible impact outside the owned taxonomy.This issue has meaningful maintainer-visible impact outside the owned taxonomy.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.
Metadata
Metadata
Assignees
Labels
P2Normal backlog priority with limited blast radius.Normal backlog priority with limited blast radius.clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.ClawSweeper found a clear likely implementation shape for this issue.clawsweeper:queueable-fixClawSweeper marked this issue as an existing queue_fix_pr work candidate.ClawSweeper marked this issue as an existing queue_fix_pr work candidate.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.impact:otherThis issue has meaningful maintainer-visible impact outside the owned taxonomy.This issue has meaningful maintainer-visible impact outside the owned taxonomy.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.
Type
Fields
Give feedbackNo fields configured for issues without a type.
Bug:
openclaw gateway restartandopenclaw statusdo not detect system-level systemd serviceSummary
When OpenClaw Gateway is installed as a system-level systemd service (
/etc/systemd/system/openclaw.service), the CLI fails to detect it:openclaw statusreportsGateway service: systemd user not installed— incorrect, the service is running via system-level systemd.openclaw gateway restarttreats the process as an "unmanaged process" and only sends SIGTERM, rather than invokingsystemctl restart openclaw.Environment
/usr/lib/node_modules/openclaw)/etc/systemd/system/openclaw.service)Reproduction
1. Install as system-level service
2. Start the service
sudo systemctl enable --now openclaw3. Check status — incorrect detection
4. Try restart — doesn't work as expected
Evidence that the process IS systemd-managed
Root Cause
The CLI only checks for a user-level systemd service (
~/.config/systemd/user/openclaw.service) and does not check for a system-level service (/etc/systemd/system/openclaw.service).Expected Behavior
openclaw statusshould detect system-level systemd services and report the service status correctly.openclaw gateway restartshould invokesystemctl restart openclaw(with appropriate privileges or a helpful error message) when the gateway is managed by a system-level systemd service.Workaround
Use
sudo systemctl restart openclawdirectly instead ofopenclaw gateway restart.Suggested Fix
In the service detection logic, also check for system-level systemd services:
When a system-level service is detected,
openclaw gateway restartshould either:systemctl restart openclaw(requires sudo/polkit), orThe current behavior of silently SIGTERM-ing the process and relying on
Restart=alwaysto recover is fragile and confusing.