Repository navigation
fix(sysext): apply merged sysusers and tmpfiles before the manager reload on a live refresh - #474
Merged
Merged
Conversation
…load on a live refresh A live refresh (enable --now, update, rollback --now, disable --now) let systemd-sysext reload the manager before the merged sysusers.d accounts existed, so upheld sockets of a new sysext failed until the next boot (lab run dev-snow-bootc-lifecycle-kb7qb, notesd and maild). DefaultRunner.Refresh now runs systemd-sysext refresh --no-reload, systemd-sysusers, systemd-tmpfiles --create --graceful, then a plain systemd-sysext refresh, whose reload and unit handling stay systemd's. ADR-0019 records the decision.
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
…ed but unfinished activation systemd 260 skips a refresh whose image set did not change, so the plain second refresh skipped the manager reload. DefaultRunner.Refresh now reads the systemd version and uses --always-refresh=yes on 260+ (and on an unreadable version), a plain refresh on 255-259, and a single plain refresh before sysusers and tmpfiles below 255. A sysusers failure after a successful last refresh wraps the new sysext.ErrActivationIncomplete; enable, disable and rollback then say the extensions are merged and a reboot finishes activation, instead of claiming they are unmerged.
…d refresh; omit tmpfiles --graceful before systemd 254
bketelsen
approved these changes
Oct 28, 2026
This was referenced Oct 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
A live refresh activated a sysext before its own
sysusers.daccounts existed. In lab rundev-snow-bootc-lifecycle-kb7qb(frostyard/lab#163, Snow20261028124727),updex features enable notesd --nowandmaild --nowreturned 0 and merged, butfrostmail,frostnotes,lodgeandlodge-appsdid not exist.systemd-sysext refreshreloaded the manager (EXTENSION_RELOAD_MANAGER=1),multi-user.target'sUpholds=startedfrostnotes-lodge.socketandfrostmail.socketat once, they failed (SocketUser=/SocketGroup=unknown) tostart-limit-hit, and the services failed on the dependency. After a reboot all passed: snosi'sreload-sysext.servicerunssystemd-sysusersandsystemd-tmpfilesbeforedaemon-reloadat boot only.sysext.DefaultRunner.Refreshnow activates in the boot order (ADR-0019):systemd-sysext refresh --no-reload— merge; the manager does not see it yetsystemd-sysuserssystemd-tmpfiles --create --graceful(no--remove, no--boot)systemd-sysext refresh --always-refresh=yes— remount the same set with systemd's own reload andEXTENSION_RESTART_UNITS=handling (--always-refresh=yesbecause systemd 260+ skips a refresh with an unchanged set)By version (
systemd-sysext --version): 260+ or unreadable → as above; 255–259 → plain step 4; <255 → one plain refresh (it never reloads), then steps 2 and 3.Failures: step 1 returns at once (as before). A sysusers failure is a refresh failure, but steps 3 and 4 still run; when step 4 succeeds the error wraps
sysext.ErrActivationIncomplete, and enable/disable/rollback say the extensions are merged and a reboot finishes activation (not "all extensions are unmerged"). A tmpfiles failure is one stderr warning (snosi#1167 rule). Step 4 failure is a refresh failure. SDK call sites are unchanged, soenable --now,update(without--no-refresh),rollback --nowanddisable --nowall get it; the timer (--no-refresh) runs none of it.Why updex and not snosi: updex runs the only live refresh on these hosts, and systemd has no hook between merge and reload, so a snosi unit could only run after the reload (too late) and would fix snosi only. Why a second refresh and not
--no-reload+systemctl daemon-reload: updex would have to copy systemd'sEXTENSION_RELOAD_MANAGER=decision and the systemd 262EXTENSION_RESTART_UNITS=/EXTENSION_RELOAD_OR_RESTART_UNITS=handling.Costs (in the ADR): two overlay remounts per live refresh (two brief gaps instead of one); on 260+ the last refresh remounts and reloads even when nothing changed; sysusers/tmpfiles act on the whole merged config; sysext
sysctl.dstays boot-only; a unit that already hit its start limit needssystemctl reset-failed. updex never restarts units itself.Checks
make fmtmake ci— passed locally (umask 022), including lint, race, e2e, cross-buildsgo test ./cmd/updex ./tests/e2e/...green insidemake cisysext/runner_test.go: order of the 4 commands; step 1 failure stops; sysusers failure continues and wraps; tmpfiles failure warns only; step 4 failure; sysusers + step 4 joined;Merge/UnmergewrappingErrActivationIncompletemessages for enable, disable, rollback.coverage-baselinebumped 90.1 → 90.2Risk classification
Rationale:
systemd-sysusers(writes/etc/passwd,/etc/group) andsystemd-tmpfiles --createas root, and remounts the overlay twice. Both tools are idempotent and are what the boot runs. Compatibility: per-version sequence, older systemd still works. Rollback: revert this commit; nothing persistent beyond accounts/paths the boot would also create.Docs housekeeping
README.md,docs/design/overview.md,docs/specs/sdk-api.md,AGENTS.mdupdatedTEMPLATE.md, indexed indocs/README.mdVerification
node scripts/check-docs.mjsgreen (insidemake ci)After a release: re-run lab's
sysext_probemode (frostyard/lab#163) on a Snow image that carries this updex; thesysext-enableboot must report the 4 accounts present and both sockets and services active without the reboot.