Repository navigation
fix(systemd): report service commands replaced by drop-ins - #128604
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 24, 2026, 5:25 AM ET / 09:25 UTC. ClawSweeper reviewWhat this changesThe PR reads systemd’s manager-effective ExecStart through structured D-Bus output so status, doctor, and updater diagnostics reflect user-unit drop-ins. Merge readinessKeep open. The prior bounded-fallback finding is addressed on the current head, and no new blocking defect was found; this maintainer-owned PR now awaits normal exact-head merge checks. Priority: P2 Review scores
Verification
Live VerificationCommand: Result: PASS (completed) Assertions:
How this fits togetherOpenClaw’s daemon service layer provides service command metadata to status, doctor, updater, and lifecycle flows. It now queries the systemd user manager for the loaded command, then falls back to the local unit file when that query is unavailable. flowchart LR
A[Service environment] --> B[Command reader]
B --> C[Systemd user manager]
C --> D[Effective ExecStart]
C --> E[Base unit fallback]
D --> F[Status doctor updater]
E --> F
Before merge
Agent review detailsSecurityNone. PR surfaceSource +82, Tests +95. Total +177 across 7 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep one manager-backed, lossless command source with the existing base-unit parser as the bounded unavailable-manager fallback; no smaller local parser can reliably reproduce drop-in precedence. Do we have a high-confidence way to reproduce the issue? Yes, from source: the base parser reads only the unit-file ExecStart while the added fixture supplies a different manager-effective argv; the branch test covers that boundary, though no live user-manager run was available here. Is this the best way to solve the issue? Yes. The manager’s structured property is the authoritative effective command source and avoids reimplementing drop-in precedence; textual show parsing would lose argument boundaries. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 7a7bb1f6709a. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (2 earlier review cycles)
|
a81ae96 to
d00539d
Compare
|
Land-ready proof for exact head
Native review artifacts are validated with |
|
Merged via squash.
|
…128604) * fix(systemd): report service commands replaced by drop-ins * test(node-host): tolerate worker startup latency * fix(systemd): bound effective command lookup
Closes #128602
What Problem This Solves
Fixes an issue where Linux operators using systemd drop-ins could see a canonical service command in OpenClaw status, doctor, and updater diagnostics even though the systemd user manager would launch a different overridden
ExecStart.Why This Change Was Made
The command reader now asks the systemd user manager for the structured D-Bus
ExecStartproperty, preserving exact argument boundaries and reusing the existing direct-user, sudo-to-user, machine-scope, bus-environment, and timeout routing. The base unit parser remains the explicit fallback for offline, installation, pre-reload, unavailable-manager, or older-systemd contexts. This deliberately avoids both lossy textualsystemctl showparsing and an incomplete reimplementation of systemd drop-in precedence.This change is generic service observability only. It does not add product-specific policy about whether an overridden command is allowed.
User Impact
OpenClaw diagnostics now report the command the systemd user manager has actually loaded when a drop-in replaces
ExecStart, allowing stale or noncanonical entrypoints to be detected instead of hidden behind the canonical base unit.Evidence
[/opt/stale/openclaw, gateway, --name, "Stale Drop-In Gateway"]; received[/usr/bin/openclaw, gateway, run].node scripts/run-vitest.mjs src/daemon/systemd.test.ts src/daemon/service.test.ts src/node-host/node-worker-supervisor.container.test.ts— 192 tests passed across the daemon and unit shards.node scripts/check-changed.mjs -- src/node-host/node-worker-supervisor.container.test.ts src/daemon/systemd-service-files.ts src/daemon/systemd-exec.ts src/daemon/service.ts src/daemon/node-service.ts src/daemon/systemd.test.ts src/daemon/service.test.ts— formatting, lint, production/test typechecks, architecture guards, dead-export checks, and import-cycle checks passed.git diff --check— passed.node-worker-supervisor.containertiming flake on currentmain. A bounded merge-tree stress run reproduced its default one-second worker-start wait failing on run 3/10. Both affected cases now share the existing five-second lifecycle deadline; the full file passed 10/10 runs, followed by the combined focused suite and changed checks.A real Linux user-manager probe was attempted but did not execute: the configured Testbox backend lacked local authentication, and two isolated AWS runners never opened SSH. Both leases were stopped and cleaned up. The systemd D-Bus and
busctl --json=shortresponse contracts were checked directly against upstream systemd source and documentation; the focused regression covers the complete OpenClaw boundary with structured manager responses.AI-assisted: yes. The implementation and tests were reviewed and verified by the maintainer.