fix(systemd): remove rechunker local-fs ordering cycle - #921
Conversation
Keep the legacy group repair before systemd-sysusers while allowing bootc's shadow sync to run first. Add a unit contract test and document the ordering invariant. Assisted-by: Goose via GitHub Copilot Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
This needs human review. |
Assert that the early-boot migration bridge retains DefaultDependencies=no alongside its local-fs ordering guard. Assisted-by: GPT-5.6 Terra via GitHub Copilot Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Prevent PR metadata from being mistaken for proof that ghost booted the candidate artifact. Assisted-by: GPT-5.6 Terra via GitHub Copilot Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
hanthor
left a comment
There was a problem hiding this comment.
LGTM. Clean, targeted fix with good test coverage.
What I checked:
- ✅
Wants=local-fs.targetandAfter=local-fs.targetremoved from the service unit - ✅ Inline comment explains the ordering cycle concisely
- ✅ Documentation in
submodule-boundary.mdupdated to explain the constraint - ✅ BATS test
does not create a local-fs ordering edgeenforces the contract - ✅ Test also asserts the remaining ordering directives are preserved (DefaultDependencies, Before=sysusers, After=bootc-sysusers-shadow-sync)
Minor note: The lab-testing SKILL.md addition about PR candidate preflight is unrelated to the systemd fix. Not a blocker — it is a useful doc addition, but mixing it in makes the PR slightly harder to review.
|
Deferred to the human queue during backlog triage — needs lab boot validation, not a desk review. This removes the
The ordering-cycle diagnosis in #918 looks correct, and the added bats guard against reintroducing the edge is a good regression net. The part that cannot be settled by reading the diff is the runtime behaviour of Also still Notably this PR also adds a lab-testing preflight note about workflows that report a PR SHA while actually booting the plain |
hanthor
left a comment
There was a problem hiding this comment.
The systemd change looks right, but the PR carries two unrelated riders — one of which regresses a generated file
The core change is sound and the new test is not vacuous
Merged into main and run, the suite is clean and matches baseline exactly (same three pre-existing failure groups as unmodified main, no new ones), and the new case passes:
$ bats tests/test_rechunker_group_fix.bats
1..8
ok 1 rechunker-group-fix: appends missing group to empty gshadow
...
ok 8 rechunker-group-fix.service: does not create a local-fs ordering edge
The assertion is real — it greps the unit for ^(Wants|Requires|After)=local-fs\.target$ and for the three edges that must survive, so reverting the unit change fails it.
Blocker 1 — the PR regresses docs/skills/index.json and index.md by 15 days and one skill
These are generated files (scripts/generate_skill_index.py; the header literally says "do not hand-edit either file"). main is at:
$ head -2 docs/skills/index.json
{
"generated_at": "2026-08-18",
$ grep -n "^Generated" docs/skills/index.md
6:Generated: 2026-08-18 · schema 1.0 · 40 skills
This PR sets them backwards to 2026-08-03 / 39 skills. That is why the branch is dirty:
$ git merge pr921
CONFLICT (content): Merge conflict in docs/skills/index.json
CONFLICT (content): Merge conflict in docs/skills/index.md
The date bump was stale on arrival and is the only reason this PR has conflicts at all. python3 scripts/generate_skill_index.py --check passes on main today; drop these two files from the diff (or rerun --write after rebasing) and the PR merges clean.
Blocker 2 — an unrelated second change the title does not mention
The title is fix(systemd): remove rechunker local-fs ordering cycle, but the diff also adds a new "PR candidate preflight" section to docs/skills/lab-testing/SKILL.md about verifying that a lab workflow's image digest resolves to the PR candidate. That is a useful paragraph and has nothing to do with rechunker ordering. Please split it out so the systemd change can be judged on its own.
Question on the fix itself (not a blocker, but please answer before merge)
docs/skills/submodule-boundary.md on main says these edges were added deliberately in common#530, and this PR deletes that provenance line along with the edges. The unit's ExecStart list writes to /etc:
ExecStart=bash -c 'touch /etc/gshadow && chmod 600 /etc/gshadow'
ExecStart=bash -c 'rm /etc/gshadow'
ExecStart=systemd-sysusers
ExecStart=rechunker-group-fix
ExecStart=systemd-tmpfiles --create --remove --boot --exclude-prefix=/devWith DefaultDependencies=no and local-fs.target removed, the only remaining ordering is After=bootc-sysusers-shadow-sync.service / Before=systemd-sysusers.service. The file header is explicit that "Users WILL experience black screens and systems will NOT boot if this script malfunctions", so: what guarantees /etc is the real, mounted, writable /etc at that point rather than a pre-mount one? The PR body asserts an ordering cycle but does not quote one. A systemd-analyze verify output, or the actual Found ordering cycle on … journal lines from an upgrade off a legacy rechunked image, would settle it — and per docs/skills/lab-testing/SKILL.md this is exactly the class of change that wants a boot-ordering VM test.
Generated by Claude Code
Summary
Wants=local-fs.targetandAfter=local-fs.targetedges fromrechunker-group-fix.servicebootc-sysusers-shadow-sync.serviceand beforesystemd-sysusers.serviceThe local-fs edges created an ordering cycle during upgrades from legacy rechunked images. The bridge unit must repair gshadow state before
systemd-sysusers.service, without pulling in or waiting forlocal-fs.target.Closes #918
Validation
bash -n system_files/shared/usr/bin/rechunker-group-fix— passedgit diff --check— passedbats tests/test_rechunker_group_fix.bats— not run:batsis not installed in the environmentsystemd-analyze verify ...— not run:systemd-analyzeis not installed in the environmentjust check— not run:justis not installed in the environmentpre-commit— not run:pre-commitis not installed in the environment