Skip to content

fix(node-cli): warn when systemd user lingering is disabled after install - #118430

Merged
Patrick-Erichsen merged 10 commits into
openclaw:mainfrom
SunnyShu0925:fix/node-install-linger-warning-107033
Aug 7, 2026
Merged

Patrick-Erichsen merged 10 commits into
openclaw:mainfrom
SunnyShu0925:fix/node-install-linger-warning-107033

Conversation

@SunnyShu0925

@SunnyShu0925 SunnyShu0925 commented Aug 3, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

openclaw node install does not warn when systemd user lingering is disabled, so the installed user-level node service is torn down when the last SSH session ends and the node silently goes offline after logout. This PR adds a read-only linger check that warns the operator to run sudo loginctl enable-linger <user>.

  • Problem: User-level systemd node service stops on SSH logout when lingering is off; no warning at install time
  • Solution: Detect disabled lingering via the existing read-only readSystemdUserLingerStatus and warn in both text and JSON modes
  • What changed: src/cli/node-cli/daemon.ts (new warnIfSystemdUserLingerDisabled helper, warn hoisted, calls on both install paths), src/cli/node-cli/daemon.test.ts (6 cases), docs/cli/node.md, docs/nodes/troubleshooting.md
  • What did NOT change: Host state is never modified (no auto-enable); non-Linux platforms; the enableSystemdUserLinger auto-enable path; nix/Windows install flows

Change Type (select all)

  • Bug fix
  • Feature
  • Refactor required for the fix
  • Docs
  • Security hardening
  • Chore/infra

Scope (select all)

  • Gateway / orchestration
  • Skills / tool execution
  • Auth / tokens
  • Memory / storage
  • Integrations
  • API / contracts
  • UI / DX
  • CI/CD / infra

Linked Issue/PR

Motivation

When a Linux node is installed as a systemd user service (openclaw node install), the
service lives in the user's systemd session. systemd tears down the user manager — and every
user service in it — when the last session for that user ends, unless lingering is enabled
(loginctl enable-linger <user>). Over SSH this means: install looks successful, you log out,
and the node is gone. There is no hint at install time that lingering is the missing piece.

This is a narrow, well-understood gap: the fix does not require choosing a product direction —
it surfaces an existing operator step (enable-linger) that the docs already imply. The check
is read-only and never auto-enables lingering, matching the operator-consent policy used
elsewhere in the installer (e.g. it warns rather than mutating host state).

Evidence

  • Behavior addressed: openclaw node install now warns when systemd user lingering is disabled, only on the verified-success path (successful fresh install and already-installed short-circuit), in text and JSON modes. A failed install or a verification failure carries no linger warning.
  • Real behavior proof (exact head fd7c8732af398d2c1e039563380f1af7add79a6c): full real-CLI run of openclaw node install against a disposable systemd user service. The proof creates a throwaway OS user with its own fresh canonical ~/.openclaw and systemd user manager, opens a real SSH logind session for it via pam_systemd (the same way an operator reaches a node host over SSH), runs the real CLI built from this head, then uninstalls the service and deletes the user. Nothing is stubbed: the CLI really writes ~/.config/systemd/user/openclaw-node.service, really enables/starts/verifies the unit, and really reads loginctl show-user <user> -p Linger. The proof host's own default profile, config, state, and linger setting are untouched.
    • Proof host: Linux x86_64, systemd 239 (239-45.el8), Node v22.22.3, real built CLI (dist/entry.js) from this head.
    • Repro: bash linger-proof-disposable-user.sh in the exact-head worktree (script is worktree-only, not committed). Transcript redacted: <proof-user> = disposable account, <repo> = exact-head checkout, <node-dir> = Node binary copy used by the disposable user.
  • Transcript (redacted):
PR #118430 real CLI proof (exact head fd7c8732af398d2c1e039563380f1af7add79a6c)
proof host: Linux 4.19.112-2.el8.x86_64 x86_64, systemd 239 (239-45.el8)
proof identity: disposable OS user <proof-user> (uid=1001), node v22.22.3
proof session: real SSH logind session for <proof-user> (pam_systemd), like a real operator login
fresh disposable user (linger initially disabled; enabled only to host the SSH session; disabled again on cleanup)

### S1. fresh install, text mode, linger=no
$ sudo loginctl disable-linger <proof-user>
$ sudo -u <proof-user> <node-dir>/node <repo>/dist/entry.js node install --no-tls --port 18789

Installed systemd service: /home/<proof-user>/.config/systemd/user/openclaw-node.service
Systemd lingering is disabled for <proof-user>. The node service will stop when you log out. Run: sudo loginctl enable-linger <proof-user>
$ systemctl --user is-enabled openclaw-node.service => enabled
$ systemctl --user is-active openclaw-node.service  => active

### S2. already-installed short-circuit, text mode, linger=no
$ sudo -u <proof-user> <node-dir>/node <repo>/dist/entry.js node install --no-tls --port 18789
Systemd lingering is disabled for <proof-user>. The node service will stop when you log out. Run: sudo loginctl enable-linger <proof-user>
Node service already enabled.
Reinstall with: openclaw node install --force

### S3. already-installed short-circuit, JSON mode, linger=no
$ sudo -u <proof-user> <node-dir>/node <repo>/dist/entry.js node install --json --no-tls --port 18789
{
  "action": "install",
  "ok": true,
  "result": "already-installed",
  "message": "Node service already enabled.",
  "service": {
    "label": "systemd user",
    "loaded": true,
    "loadedText": "enabled",
    "notLoadedText": "disabled"
  },
  "warnings": [
    "Systemd lingering is disabled for <proof-user>. The node service will stop when you log out. Run: sudo loginctl enable-linger <proof-user>"
  ]
}

### S4. fresh install, JSON mode, linger=no (after uninstall)
$ sudo -u <proof-user> <node-dir>/node <repo>/dist/entry.js node uninstall
$ sudo -u <proof-user> <node-dir>/node <repo>/dist/entry.js node install --json --no-tls --port 18789
{
  "action": "install",
  "ok": true,
  "result": "installed",
  "service": {
    "label": "systemd user",
    "loaded": true,
    "loadedText": "enabled",
    "notLoadedText": "disabled"
  },
  "warnings": [
    "Systemd lingering is disabled for <proof-user>. The node service will stop when you log out. Run: sudo loginctl enable-linger <proof-user>"
  ]
}

### S5. fresh install, text mode, linger=yes (expect NO warning)
$ sudo loginctl enable-linger <proof-user>
$ sudo -u <proof-user> <node-dir>/node <repo>/dist/entry.js node uninstall
$ sudo -u <proof-user> <node-dir>/node <repo>/dist/entry.js node install --no-tls --port 18789

Installed systemd service: /home/<proof-user>/.config/systemd/user/openclaw-node.service

Removed systemd service: /home/<proof-user>/.config/systemd/user/openclaw-node.service
### cleanup verification
$ systemctl --user is-enabled openclaw-node.service => Failed to get unit file state for openclaw-node.service: No such file or directory
$ systemctl --user is-active openclaw-node.service  => inactive

ALL SCENARIOS PASSED at exact head fd7c8732af398d2c1e039563380f1af7add79a6c

Behavior matrix (real loginctl linger state × install path):

linger   install path                => result
=no      fresh-install SUCCESS (text)=> warning with enable-linger command
=no      fresh-install SUCCESS (JSON)=> ok:true, result:installed, warnings[]=enable-linger
=no      fresh-install VERIFY FAILS  => ok:false, "verification failed", NO linger warning  ← review fix
=no      fresh-install install THROWS=> ok:false, "install failed", NO linger warning
=no      already-installed           => ok:true, already-installed, warnings[]=enable-linger
=yes     any success path            => NO warning (no over-warning)
=yes     verify fails / install throws=> NO linger warning
non-Linux any path                   => skipped
  • Observed result after fix (real CLI run unless noted):
    1. With lingering disabled, a successful fresh install prints Systemd lingering is disabled for <user>. The node service will stop when you log out. Run: sudo loginctl enable-linger <user> in text mode.
    2. In JSON mode the same message appears in the warnings array of the success payload (ok:true, result:"installed").
    3. The already-installed short-circuit (openclaw node install when already loaded, no --force) also warns.
    4. A failed install (service.install throws) emits ok:false with the install error and no linger warning (verified by the worktree-only evidence test; the real CLI cannot be forced to throw without breaking the disposable service).
    5. A verification failure (service.isLoaded returns false after install) emits ok:false with "verification failed" and no linger warning — the linger diagnostic runs only after verification succeeds (review fix; verified by the evidence test + unit tests).
    6. With lingering already enabled, no warning is emitted on any path.
  • Exact-head sudo/root account-selection proof (head 434c2b471c8a, then docs commit fd7c8732): the real-CLI transcript above runs on fd7c8732; the follow-up resolveSystemdUserServiceAccount repair (aligning the linger lookup with the systemctl service owner across sudo-to-root and real-root-user-manager states) is proven separately below. The resolver is a pure function of process.env + os.userInfo()/process.geteuid(); to reproduce the sudo/root process states on a normal uid-1000 proof host, os.userInfo and process.geteuid are stubbed to the exact values the PR's own unit tests use in src/daemon/systemd.test.ts (the "resolves the sudo caller..." and "resolves root for a real root user-manager..." cases), and the env objects are the verbatim env from those same test cases. The resolved account is then fed to the real loginctl show-user <user> -p Linger binary (systemd 239) — the exact command src/daemon/systemd-linger.ts:readSystemdUserLingerStatus executes on this head — showing the linger warning targets the same account systemctl targets.
    • Repro: tsx linger-proof.ts against the verbatim resolveSystemdUserServiceAccount chain copied from src/daemon/systemd.ts (head 434c2b47, lines 902-924 and 951-1001).
    • Proof host: Linux x86_64, Node v22.22.3, systemd 239 (239-45.el8), real identity uid=1000 user=0668000539 (linger=yes).
    • Transcript (redacted; <real user> = the proof host's own account so loginctl answers instead of "no such user"):
PR #118430 head: 434c2b471c8a6e53f8f845b3719d5962fafebde0
proof host real identity: uid=1000 user=0668000539
loginctl: systemd 239 (239-45.el8)

### A. sudo-to-root: euid=0, SUDO_USER=<real user>, non-root bus env
  stub effective uid=0, os.userInfo.username=root
  env={"SUDO_USER":"0668000539","USER":"root","LOGNAME":"root"}
  resolveSystemdUserServiceAccount(env) => "0668000539"
  loginctl show-user 0668000539 -p Linger => Linger=yes

### B. real root user-manager: HOME=/root, XDG_RUNTIME_DIR=/run/user/0, DBUS=/run/user/0/bus
  stub effective uid=0, os.userInfo.username=root
  env={"HOME":"/root","USER":"root","LOGNAME":"root","SUDO_USER":"debian","XDG_RUNTIME_DIR":"/run/user/0","DBUS_SESSION_BUS_ADDRESS":"unix:path=/run/user/0/bus"}
  resolveSystemdUserServiceAccount(env) => "root"
  loginctl show-user root -p Linger => Linger=no

### C. non-root effective: USER=<real user>, stale SUDO_USER=admin
  stub effective uid=1000, os.userInfo.username=0668000539
  env={"USER":"0668000539","SUDO_USER":"admin"}
  resolveSystemdUserServiceAccount(env) => "0668000539"
  loginctl show-user 0668000539 -p Linger => Linger=yes

### D. live proof-host identity (no stub), real loginctl
  resolveSystemdUserServiceAccount(process.env) => "0668000539"
  loginctl show-user 0668000539 -p Linger => Linger=yes
  (pre-fix counterfactual: resolveLoginctlUser would target USER=0668000539)
  • Reading: under sudo-to-root (A) the resolver returns the sudo caller (0668000539), not root, so the linger warning and systemctl --machine=<caller>@ target the same account; under a real root user-manager (B) it returns root (the genuine root session, not a stale SUDO_USER); under a non-root effective identity (C) it ignores a stale SUDO_USER and returns the effective account; (D) confirms the live wiring on the proof host. The sudo/root account-selection invariant — the gap the 434c2b47 repair closed — holds in all four states.
  • What was not tested: A real end-to-end "log out and observe the service survive" across a fresh SSH session was not performed (would require a real unit plus an actual logout); the install-throws and verification-failure paths are covered by the worktree-only evidence test and unit tests rather than the real CLI (the real CLI cannot be forced into those failure states without breaking the disposable service). Windows/macOS/nix install flows are out of scope (Linux-only).

Root Cause

The installer (runNodeDaemonInstall in src/cli/node-cli/daemon.ts) installs a systemd user
service but never checks whether the user manager will persist after logout. systemd's user
manager exits with the last session unless loginctl enable-linger <user> has been run, so a
"successful" install silently goes offline on SSH logout. No prior code path read linger status
at install time (the existing readSystemdUserLingerStatus was only used by Doctor diagnostics,
#97514).

Lifecycle placement (review fix): the shared installer
installDaemonServiceAndEmit (src/cli/daemon-cli/response.ts) writes the service, then
verifies it is loaded (service.isLoaded), and only then emits the success payload. The linger
diagnostic must run on that verified-success path — not inside the install callback (which runs
before verification). This PR adds an optional onVerified hook to
installDaemonServiceAndEmit for post-success diagnostics, and runs the linger warning there, so
a failed install or verification failure never tells the operator to fix lingering.

Regression Test Plan

  • src/cli/node-cli/daemon.test.ts adds 7 cases: warns after fresh install (text), warns in JSON
    warnings, warns on already-installed short-circuit, does NOT warn when linger=yes, does NOT
    pollute failure output when service.install throws, does NOT warn when service-load
    verification fails (review regression), and skips when systemd user service is unavailable.
    All 19 cases in the file pass.
  • src/cli/daemon-cli/response.test.ts adds 2 cases for the new shared onVerified seam: it runs
    after verification succeeds and before the success emit, and a thrown onVerified surfaces as a
    failure with no success emit. All 6 cases in the file pass.
  • src/cli/daemon-cli/install.test.ts (37 cases) passes unchanged — the optional onVerified
    hook does not affect the other installer caller.
  • Real-linger evidence test (worktree-only, not committed) confirms behavior against a live
    loginctl toggle under both linger states.
  • Real-CLI proof (worktree-only script, not committed): bash linger-proof-disposable-user.sh
    runs the real openclaw node install CLI at the exact PR head against a disposable systemd
    user service, covering fresh install text/JSON, already-installed text/JSON, linger=yes no-warn,
    and full cleanup (service removed, user deleted, linger restored).

User-visible / Behavior Changes

openclaw node install on Linux now prints an additional warning line (text mode) or appends to
the warnings array (JSON mode) when systemd user lingering is disabled. No behavior change when
lingering is enabled or on non-Linux platforms. Host state is never modified.

Security Impact

  • New permissions/capabilities? No — read-only loginctl show-user; never enables linger.
  • Secrets/tokens handling changed? No
  • New/changed network calls? No
  • Command/tool execution changed? No — runs the same read-only loginctl already used by Doctor.
  • Data access scope changed? No

Human Verification

  • Verified scenarios: real CLI run on a disposable systemd user service — fresh install text + JSON
    (warns on linger=no), already-installed text + JSON (warns), linger=yes no-op (no warning),
    cleanup (service removed, disposable user deleted, linger restored). Unit/evidence-test scenarios:
    verification-failure no-warn (review regression), install-throws no-warn, systemd-unavailable
    skip — under both real linger states (toggled via loginctl).
  • Edge cases checked: linger diagnostic runs only on the verified-success path via onVerified
    (failure isolation for both install-throws and verification-fails), warn callback hoisted
    before the already-installed short-circuit, non-Linux early return, systemd-unavailable early
    return, onVerified throw surfaces as a failure (does not silently pass).
  • What you did NOT verify: cross-session SSH logout survival of a real unit (would need a real
    systemd unit + second session); the auto-enable enableSystemdUserLinger path (intentionally
    not reused — it changes host state).

Compatibility / Migration

  • Backward compatible? Yes — purely additive warning; no existing output removed.
  • Config/env changes? No
  • Migration needed? No

Best-fix Verdict

  • Best fix: Yes — surfaces the operator step at the moment it matters (install), read-only,
    on both install paths, reusing the existing readSystemdUserLingerStatus rather than
    duplicating detection. Avoids the two pitfalls that closed prior PRs (feat(node): warn when systemd linger is not enabled after node install #107061 linger-before-
    install polluting failure output; fix(nodes): keep Linux nodes online after logout #107068 missing the already-installed path).
  • Refactor needed: No
  • Alternative considered: Auto-enabling lingering (enableSystemdUserLinger exists) — rejected
    because it mutates host state without operator consent; warning + documented command keeps the
    operator in control, consistent with the installer's existing warn-don't-mutate posture.

AI Assistance

Risks and Mitigations

  • Highest risk: warning could fire in environments where the user manager persists via a
    non-enable-linger mechanism (e.g. systemd --user started manually, or a system-level
    service masquerading as user-level). Mitigation: the check only warns (does not block or
    mutate), and the message names the exact remediation; a false positive is a harmless extra
    line. The docs note not to mix user/system-level services.
  • Compatibility: additive only; no existing output removed, no config/env change, no breaking
    change. Existing users with lingering enabled see no difference.
  • The linger check calls loginctl show-user, which is already used by Doctor (Doctor: expose systemd linger findings #97514); no new
    external dependency or privilege escalation.

Final exact-head landing proof

  • Reviewed/final head: 98404c7f63e5344a6355892c5dbe87a836fd1812.
  • Gateway + Doctor production boundary: Blacksmith Testbox run 31138749639 built parent 4fd7064eaab9d41a1cb8c5bb16bd905843a4ffd3 and exercised a disposable non-root Linux systemd user with Linger=no. Gateway and Doctor both resolved the canonical service owner, emitted account-specific loginctl enable-linger guidance, and completed disposable-user cleanup. The proof command completed before the wrapper was cancelled during post-proof teardown.
  • Final-head continuity: 98404c7f63e5344a6355892c5dbe87a836fd1812 differs from that production-proven parent only by six mock-setup lines in src/wizard/setup.finalize.test.ts; no production file changed.
  • Repair proof: 45/45 focused fixture tests and exact-file formatting/lint passed before Testbox wrapper teardown.
  • Exact-head hosted CI: run 31140142098 completed successfully at 98404c7f63e5344a6355892c5dbe87a836fd1812 with no pending or failing selected checks.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation cli CLI command changes size: S labels Aug 3, 2026
@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P1 High-priority user-facing bug, regression, or broken workflow. labels Aug 3, 2026
@clawsweeper

clawsweeper Bot commented Aug 3, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed August 6, 2026, 9:33 PM ET / August 7, 2026, 01:33 UTC.

ClawSweeper review

What this changes

Adds Linux node-install linger warnings and makes Node, Gateway, and Doctor inspect the same systemd user-service owner.

Merge readiness

⛔ Blocked until stronger real behavior proof is added - 4 items remain

Keep open: current main does not contain the node warning or shared service-owner alignment. The patch has no supported correctness finding, but the later Gateway and Doctor expansion still needs current-head production-boundary proof before merge.

Priority: P1
Reviewed head: 4fd7064eaab9d41a1cb8c5bb16bd905843a4ffd3

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The implementation is coherent and covered by focused tests, but current-head real behavior proof does not yet cover all expanded diagnostics.
Proof confidence 🦐 gold shrimp (3/6) Needs stronger real behavior proof before merge: The real terminal transcript convincingly covers the earlier node warning, but not the later Gateway and Doctor account-alignment behavior on the current head; add redacted current-head production-boundary output before merge. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Needs proof Needs stronger real behavior proof before merge: The real terminal transcript convincingly covers the earlier node warning, but not the later Gateway and Doctor account-alignment behavior on the current head; add redacted current-head production-boundary output before merge. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Evidence reviewed 6 items Current-main comparison: Current main still uses environment-only linger lookup in Gateway and Doctor and lacks the shared service-owner resolver, so this PR remains necessary.
Shared owner boundary: The branch derives the linger account from the same systemctl scope used for service operations, then applies it in Node, Gateway, and Doctor paths.
Focused coverage: Branch tests cover sudo-to-root, real-root manager, stale SUDO_USER, Gateway/Doctor target identity, and node success/failure warning placement.
Findings None None.
Security None None.

How this fits together

Node installation creates and verifies a user-level systemd service. The changed diagnostics resolve that service’s owning account, read its lingering state, and return recovery guidance through CLI output or Doctor findings.

flowchart LR
A[Node or Gateway operation] --> B[Resolve systemd service owner]
B --> C[Read loginctl lingering state]
C --> D{Lingering disabled?}
D -->|Yes| E[CLI warning or Doctor finding]
D -->|No| F[Successful service workflow]
E --> G[Operator enables lingering]
Loading

Before merge

  • Add real behavior proof - Needs stronger real behavior proof before merge: The real terminal transcript convincingly covers the earlier node warning, but not the later Gateway and Doctor account-alignment behavior on the current head; add redacted current-head production-boundary output before merge. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
  • Resolve merge risk (P1) - The later Gateway and Doctor owner-alignment change lacks a current-head production-boundary run; a wrong account diagnosis can send an operator to enable lingering for the wrong user while the real service still stops after logout.
  • Resolve merge risk (P1) - The branch is behind current main, so it needs a refresh and green exact-head checks before merge.
  • Complete next step (P2) - The existing open PR already owns the code; the remaining work is contributor proof and a review refresh, not a separate repair task.
Agent review details

Security

None.

PR surface

Source +87, Tests +355, Docs +42. Total +484 across 13 files.

View PR surface stats
Area Files Added Removed Net
Source 6 103 16 +87
Tests 5 357 2 +355
Docs 2 42 0 +42
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 13 502 18 +484

Review metrics

Metric Value Why it matters
Production versus test delta production +145/-16, tests +357/-2 The production growth is justified by the user-visible warning and one shared service-owner invariant; the test growth covers its affected callers.

Stored data model

Persistent data-model change detected: migration/backfill/repair: src/flows/doctor-health-contributions.test.ts, migration/backfill/repair: src/flows/doctor-health-contributions.ts, unknown-data-model-change: src/flows/doctor-health-contributions.test.ts. Confirm migration or upgrade compatibility proof before merge.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #107033
Summary: This PR is the active candidate repair for the node service silently going offline after logout.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Merge-risk options

Maintainer options:

  1. Add current-head production proof (recommended)
    Run Gateway linger handling and the selected Doctor linger check through a real systemd user-service boundary, including sudo-to-root, and show the corrected account and resulting diagnostic.

Technical review

Best possible solution:

Refresh against current main, then prove on a real Linux systemd host that Gateway and Doctor pass the same account to loginctl that systemctl uses, including a sudo-to-root case.

Do we have a high-confidence way to reproduce the issue?

Yes. A disposable Linux user with a real systemd user manager can reproduce the node-offline-after-logout path; the submitted transcript demonstrates that central path, while the expanded Gateway/Doctor path still needs a current-head run.

Is this the best way to solve the issue?

Yes, with the remaining proof gap. Reusing the service-owner resolver is the narrowest maintainable fix because every linger diagnostic now follows the account actually targeted by systemctl.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 53006a289e76.

Labels

Label changes:

  • add merge-risk: 🚨 availability: An incorrect linger account diagnosis can leave the actual user service unprotected and offline after logout.

Label justifications:

  • P1: A successful node installation can otherwise leave an SSH-installed node silently offline after logout.
  • merge-risk: 🚨 availability: An incorrect linger account diagnosis can leave the actual user service unprotected and offline after logout.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs stronger real behavior proof before merge: The real terminal transcript convincingly covers the earlier node warning, but not the later Gateway and Doctor account-alignment behavior on the current head; add redacted current-head production-boundary output before merge. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Evidence

What I checked:

  • Current-main comparison: Current main still uses environment-only linger lookup in Gateway and Doctor and lacks the shared service-owner resolver, so this PR remains necessary. (src/commands/systemd-linger.ts:40, 53006a289e76)
  • Shared owner boundary: The branch derives the linger account from the same systemctl scope used for service operations, then applies it in Node, Gateway, and Doctor paths. (src/daemon/systemd.ts:992, 4fd7064eaab9)
  • Focused coverage: Branch tests cover sudo-to-root, real-root manager, stale SUDO_USER, Gateway/Doctor target identity, and node success/failure warning placement. (src/daemon/systemd.test.ts:343, 4fd7064eaab9)
  • Proof continuity: The submitted real CLI transcript proves the earlier node-warning behavior at fd7c873, while the Gateway/Doctor service-owner expansion was added in 3f8e618 and has no current-head production-boundary run. (src/flows/doctor-health-contributions.ts:309, 3f8e618fede2)
  • Documentation routing check: The changed CLI and troubleshooting pages are present in the docs navigation; pnpm docs:list was not run because Corepack attempted a cache write in the read-only checkout. Public docs: docs/docs.json. (docs/docs.json:1753, 4fd7064eaab9)
  • Security pass: The diff adds no dependencies, workflows, package metadata, or secret handling; the account is passed to loginctl as a separate argv value with shell disabled. (src/daemon/systemd-linger.ts:31, 4fd7064eaab9)

Likely related people:

  • Patrick-Erichsen: Authored the resolver and extended its invariant across Node, Gateway, and Doctor on this branch. (role: service-owner alignment author; confidence: high; commits: 434c2b471c8a, 3f8e618fede2; files: src/daemon/systemd.ts, src/commands/systemd-linger.ts, src/flows/doctor-health-contributions.ts)
  • giodl73-repo: Authored the merged Doctor systemd-linger work that this branch extends with correct service-owner targeting. (role: prior Doctor linger contributor; confidence: medium; commits: 7bb686c14012; files: src/flows/doctor-health-contributions.ts)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Add a redacted current-head Linux systemd run for Gateway and Doctor that demonstrates correct service-owner targeting.
  • Refresh onto current main and obtain green exact-head checks.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (12 earlier review cycles; latest 8 shown)
  • reviewed 2026-08-03T19:23:17.176Z sha 75dd87c :: needs maintainer review before merge. :: none
  • reviewed 2026-08-06T02:34:16.886Z sha 75dd87c :: needs maintainer review before merge. :: none
  • reviewed 2026-08-06T04:41:13.924Z sha 434c2b4 :: needs maintainer review before merge. :: none
  • reviewed 2026-08-06T04:49:50.517Z sha 434c2b4 :: needs real behavior proof before merge. :: [P3] Narrow the node-service crash-loop claim
  • reviewed 2026-08-06T06:37:05.890Z sha fd7c873 :: needs real behavior proof before merge. :: [P1] Use the service owner in Gateway linger paths
  • reviewed 2026-08-06T09:37:09.541Z sha fd7c873 :: needs changes before merge. :: [P1] Pass the service owner to every linger diagnostic
  • reviewed 2026-08-06T09:46:44.023Z sha fd7c873 :: needs changes before merge. :: [P1] Resolve the service owner in Gateway linger checks
  • reviewed 2026-08-07T00:37:25.527Z sha e6bebc4 :: needs real behavior proof before merge. :: none

@SunnyShu0925
SunnyShu0925 force-pushed the fix/node-install-linger-warning-107033 branch from 776eb8d to 6bd7b57 Compare August 3, 2026 04:04
@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Aug 3, 2026
@SunnyShu0925
SunnyShu0925 force-pushed the fix/node-install-linger-warning-107033 branch 2 times, most recently from 4a81ec9 to 3796c3f Compare August 3, 2026 04:52
…r install

openclaw node install now detects when systemd user lingering is off and
warns the operator (text + JSON) to run 'sudo loginctl enable-linger <user>'.
Without lingering, the user-level node service is torn down when the last SSH
session ends, so the node silently goes offline after logout.

The check is read-only and never auto-enables lingering, matching the
operator-consent policy used elsewhere. It runs only on the verified-success
path: an optional onVerified hook is added to installDaemonServiceAndEmit
that fires after service.isLoaded() confirms the service is loaded and before
the success payload is emitted. The linger diagnostic runs there, so a failed
install or verification failure never carries a linger warning (avoids
misdirecting the operator to fix lingering for a service that was not
successfully installed). The already-installed short-circuit warns separately.
Skipped on non-Linux and when systemd user service is unavailable.

Adds unit tests for both paths, the linger=yes no-op, the install-failure
isolation, the verification-failure no-warn regression, and the
systemd-unavailable skip, plus response.test.ts cases covering onVerified
running on success and failing safely when it throws. The
readSystemdUserLingerStatus mock is typed with the full linger union to
satisfy tsgo. Documents the linger step in docs/cli/node.md and
docs/nodes/troubleshooting.md.

Real-behavior evidence captured on a Linux host by toggling
loginctl disable-linger/enable-linger and running the real install flow:
linger=no emits the warning on successful install (text + JSON) and on the
already-installed path; linger=yes emits nothing; a failed install or
verification failure emits no warning.

Fixes openclaw#107033

Co-Authored-By: deepseek-v4-flash <[email protected]>
@SunnyShu0925
SunnyShu0925 force-pushed the fix/node-install-linger-warning-107033 branch from 3796c3f to 75dd87c Compare August 3, 2026 04:55
@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. clawsweeper-recovery-stuck and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. labels Aug 3, 2026
@SunnyShu0925

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review — clearing the stuck review-recovery marker: a fresh review started on 2026-08-05 but never produced a durable verdict; please re-review the current head (75dd87c).

@clawsweeper

clawsweeper Bot commented Aug 6, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@Patrick-Erichsen

Copy link
Copy Markdown
Contributor

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Command router queued. I will update this comment with the next step.

@Patrick-Erichsen

Copy link
Copy Markdown
Contributor

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Aug 7, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@clawsweeper clawsweeper Bot added status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. and removed proof: sufficient ClawSweeper judged the real behavior proof convincing. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. labels Aug 7, 2026
@Patrick-Erichsen

Copy link
Copy Markdown
Contributor

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Command router queued. I will update this comment with the next step.

@Patrick-Erichsen

Copy link
Copy Markdown
Contributor

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Aug 7, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@clawsweeper clawsweeper Bot added the merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. label Aug 7, 2026
@Patrick-Erichsen

Copy link
Copy Markdown
Contributor

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Command router queued. I will update this comment with the next step.

@Patrick-Erichsen Patrick-Erichsen left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved at exact head 98404c7. Exact-head production systemd proof passed, the CI-fixture repair passed 45/45 focused tests plus formatting/lint, and fresh autoreview is clean.

@Patrick-Erichsen

Copy link
Copy Markdown
Contributor

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Command router queued. I will update this comment with the next step.

@Patrick-Erichsen
Patrick-Erichsen merged commit 21e9634 into openclaw:main Aug 7, 2026
126 checks passed
@Patrick-Erichsen

Copy link
Copy Markdown
Contributor

Merged via squash.

vincentkoc added a commit to VACInc/openclaw that referenced this pull request Aug 7, 2026
* origin/main: (58 commits)
  fix(test): restart shared gateway after migration convergence (openclaw#120089)
  fix(ui): make active-run steering reliable (openclaw#120083)
  fix(telegram): preserve voice fallback text
  test(swift): preserve queued websocket frames (openclaw#120106)
  fix: reject missing oxlint shard selectors (openclaw#120096)
  test(channels): align prerelease fallback catalog spec (openclaw#120092)
  fix(node-cli): warn when systemd user lingering is disabled after install (openclaw#118430)
  fix(diagnostics): preserve CLI turn usage totals (openclaw#120100)
  fix(gateway): derive lock and coordinator paths from the resolved state dir (openclaw#120110)
  fix(release): isolate private Telegram QA harness (openclaw#120088)
  test(agents): exercise execution attribution ingress guard
  fix(gateway): defer attribution until admission succeeds
  refactor(agents): centralize exact execution attribution
  fix(google): accept base64url provider media (openclaw#116204)
  fix(plugins): warn when registerHook uses a typed hook event name (openclaw#118601)
  fix(canvas): serve Content-Length on A2UI HEAD responses (openclaw#117961)
  fix(gateway): make doctor dreaming timestamp comparators NaN-safe (openclaw#118749)
  fix(heartbeat): explain target-none skips (openclaw#119689)
  fix(security): stop recommending retired install-policy bypasses (openclaw#120011)
  fix(plugins): preserve startup release during repair (openclaw#120085)
  ...

# Conflicts:
#	CHANGELOG.md
#	src/config/sessions/session-accessor.sqlite-transcript-write.ts
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 7, 2026
…tall (openclaw#118430)

* [AI] fix(node-cli): warn when systemd user lingering is disabled after install

openclaw node install now detects when systemd user lingering is off and
warns the operator (text + JSON) to run 'sudo loginctl enable-linger <user>'.
Without lingering, the user-level node service is torn down when the last SSH
session ends, so the node silently goes offline after logout.

The check is read-only and never auto-enables lingering, matching the
operator-consent policy used elsewhere. It runs only on the verified-success
path: an optional onVerified hook is added to installDaemonServiceAndEmit
that fires after service.isLoaded() confirms the service is loaded and before
the success payload is emitted. The linger diagnostic runs there, so a failed
install or verification failure never carries a linger warning (avoids
misdirecting the operator to fix lingering for a service that was not
successfully installed). The already-installed short-circuit warns separately.
Skipped on non-Linux and when systemd user service is unavailable.

Adds unit tests for both paths, the linger=yes no-op, the install-failure
isolation, the verification-failure no-warn regression, and the
systemd-unavailable skip, plus response.test.ts cases covering onVerified
running on success and failing safely when it throws. The
readSystemdUserLingerStatus mock is typed with the full linger union to
satisfy tsgo. Documents the linger step in docs/cli/node.md and
docs/nodes/troubleshooting.md.

Real-behavior evidence captured on a Linux host by toggling
loginctl disable-linger/enable-linger and running the real install flow:
linger=no emits the warning on successful install (text + JSON) and on the
already-installed path; linger=yes emits nothing; a failed install or
verification failure emits no warning.

Fixes openclaw#107033

Co-Authored-By: deepseek-v4-flash <[email protected]>

* fix(node-cli): align linger user with service owner

* docs(node): narrow crash-loop claim to gateway units

The duplicate-scope guard that raises on two managers running the same unit
name is enforced for gateway units (two supervisors on the same port SIGTERM
each other in a restart loop); assertNoSystemGatewayOwnership returns early
for node services, so claiming node services crash-loop misattributes gateway
behavior. Qualify the troubleshooting note accordingly.

Addresses ClawSweeper P3 finding on PR openclaw#118430.

* fix(systemd): align linger checks with service owner

* test(doctor): align linger status mock contract

* style(doctor): format linger mock

* test(wizard): mock systemd service account

---------

Co-authored-by: deepseek-v4-flash <[email protected]>
Co-authored-by: Patrick Erichsen <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cli CLI command changes commands Command implementations docs Improvements or additions to documentation gateway Gateway runtime merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. P1 High-priority user-facing bug, regression, or broken workflow. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: M status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Docs: loginctl enable-linger is not mentioned in node setup docs, causing silent node disconnects

2 participants