Daemon: handle degraded systemd status checks#39325
Conversation
Greptile SummaryThis PR fixes two related daemon lifecycle bugs on Linux: (1) Key changes:
Key issue identified:
The core bug fixes are well-motivated and covered by targeted tests. However, the broadened Confidence Score: 4/5
Last reviewed commit: af55ca1 |
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
* Daemon: handle degraded systemd status checks * Changelog: note systemd status handling * Update src/commands/status.service-summary.ts Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> --------- Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
* Daemon: handle degraded systemd status checks * Changelog: note systemd status handling * Update src/commands/status.service-summary.ts Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> --------- Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
* Daemon: handle degraded systemd status checks * Changelog: note systemd status handling * Update src/commands/status.service-summary.ts Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> --------- Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
* Daemon: handle degraded systemd status checks * Changelog: note systemd status handling * Update src/commands/status.service-summary.ts Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> --------- Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
* Daemon: handle degraded systemd status checks * Changelog: note systemd status handling * Update src/commands/status.service-summary.ts Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> --------- Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
* Daemon: handle degraded systemd status checks * Changelog: note systemd status handling * Update src/commands/status.service-summary.ts Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> --------- Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
Summary
systemctl --user statusresults were still treated as unavailable onmain, and status surfaces still reported externally managed running services asnot installed.isSystemdUserServiceAvailable()andassertSystemdAvailable()now distinguish degraded sessions from truly unavailable user-bus/systemd cases; status summary logic now reports running unmanaged services asrunning (externally managed)instead ofnot installed; added regression coverage and changelog note.Change Type (select all)
Scope (select all touched areas)
Linked Issue/PR
User-visible / Behavior Changes
openclaw status/openclaw status --allno longer claimsystemd not installedwhen the gateway is running under an externally managed service.systemctl --user statusresults as available, while still surfacing real user-bus unavailability early.Security Impact (required)
Yes/No) NoYes/No) NoYes/No) NoYes/No) NoYes/No) NoYes, explain risk + mitigation:Repro + Verification
Environment
Steps
pnpm vitest src/daemon/systemd.test.ts src/commands/status.service-summary.test.ts src/commands/configure.daemon.test.ts src/cli/daemon-cli/install.test.ts src/infra/wsl.test.ts src/daemon/systemd-hints.test.ts.pnpm build.systemctl --user statusis treated as available and externally managed running services are not shown asnot installed.Expected
Actual
pnpm buildcompleted successfully locally.running (externally managed).Evidence
Human Verification (required)
systemctl --user status; unavailable user-bus errors; service stop guard behavior; externally managed running service summary detection.Compatibility / Migration
Yes/No) YesYes/No) NoYes/No) NoFailure Recovery (if this breaks)
src/daemon/systemd.ts,src/commands/status*.ts, andsrc/commands/status.service-summary.ts.not installed.Risks and Mitigations