Repository navigation
fix(doctor): unblock runtime cleanup after systemd re-exec - #178117
Conversation
Recognize a standard systemd user manager with a numeric deserialize fd so its protected PAM child does not block abandoned updater runtime cleanup. Preserve account, parent, and artifact-custody checks in the census owner shared by Doctor and update repair. Fixes #177876. Co-authored-by: sunlit-deng <[email protected]>
|
🦞👀 Pull request received. I will update this pull request when review starts. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 60c7e6b802
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| argv.length <= 3 && | ||
| argv[1] === "--user" && | ||
| argv.slice(2).every((arg) => /^--deserialize=\d+$/u.test(arg)) && |
There was a problem hiding this comment.
Accept systemd's split deserialize form
On hosts running systemd 249, the upstream re-exec path emits four argv elements—--user, --deserialize, and the fd separately (systemd v249 source). The new argv.length <= 3 check and --deserialize=\d+ matcher therefore reject that legitimate manager, so it and its (sd-pam) child remain unverified when their cwd is unreadable and continue blocking Doctor cleanup/update repair. Accept the split --deserialize, <fd> representation as well as the newer equals form.
AGENTS.md reference: AGENTS.md:L75-L76
Useful? React with 👍 / 👎.
…ess census (openclaw#178117) Fixes openclaw#177876. Supersedes openclaw#177911, thanks @sunlit-deng. Co-authored-by: sunlit-deng <[email protected]>
What Problem This Solves
Fixes update recovery getting stuck on retained runtimes when a Linux systemd user manager re-execs with
--deserialize=<fd>and its(sd-pam)child has an unreadable working directory.Fixes #177876.
User Impact
Doctor can reclaim abandoned updater runtimes and release their recovery-journal hardlinks so updating can continue. Actual runtime holders and unverified processes remain protected. No new settings, schema changes, or operator actions are introduced.
Why This Change Was Made
The process-census owner required exactly two argv entries, so the legitimate deserialization argument also defeated its same-UID PAM-child exemption. The existing predicate now accepts one optional numeric deserialization argument while retaining the exact executable paths, account checks, parent relationship, and artifact-custody checks. Both Doctor cleanup and update repair consume that same owner.
This independently reimplements the fix and consolidates the existing systemd test coverage. Supersedes #177911, thanks @sunlit-deng.
Evidence
578578cdeca99cfea9d32df2ee6c46197a3c22aa: both deserialized-manager cases failed with manager/PAM PIDs and unavailable-cwd warnings; the standard-manager case passed. The run took 357.11 seconds overall, with 257.5 seconds spent preparing the shared worker bundle.tsconfig.core.jsonandtest/tsconfig/tsconfig.core.test.infra.json). Oxlint passed on both changed TypeScript files, oxfmt andgit diff --checkpassed, and the Madge import-cycle check reported zero cycles. The census file stays below the existing 1,000-line lint limit without a suppression or baseline edit.ui/src/e2e/session-scoped-delivery.e2e.test.ts:103reports TS2367. These files and inventories are unchanged. Fullcheck:changedwas not run because its SQLite inventory stalls locally; focused checks and PR CI provide the selected proof.docker run --rm --network none node:26-bookworm sh -c 'command -v systemd || true; ls -l /sbin/init 2>/dev/null || true; node --version'never created a container or produced output after more than five minutes. The task-owned client was stopped; no shared service was restarted. The census regression uses synthetic Linux procfs observations, not a live systemd manager.Focused command