Conversation
FSDK has no catch-all "disable *", so units without a preset line are enabled on first boot. The dogfood boot log shows isnsd.socket, isnsd.service and systemd-homed.service all started. isnsd is open-isns's iSNS server and listens on TCP 3205 on every interface; the iSCSI initiator does not need it. Nothing here uses homed (root ships locked, accounts come from sysusers and Ignition). 80-bluefin-unused.preset disables them. Presets apply on first boot only, so bluefin-disable-unused-migrate runs `systemctl preset --now` on exactly those four units once on installed nodes that updated into this image; a preset that enables one (Ignition's) still wins. Assisted-by: Claude via Claude Code Co-Authored-By: Claude Code <noreply@anthropic.com>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: Needs approval from an approver in each of these files:Approvers can indicate their approval by writing |
There was a problem hiding this comment.
Summary: This change switches off two background services that every server was starting for no reason: a network name server that listened for connections from anywhere, and a home-directory manager no account uses. It also switches them off on servers that are already installed. It looks correct and safe to merge. One small edge case is noted below: a server whose administrator has already blocked one of these services by hand may retry the switch-off on every boot.
Reviewed head 7283e2cf. Checks at this head: unit, go, docs, actionlint, zizmor pass. The image build and boot test were skipped, so the claim that the boot log loses these lines is still unverified (the PR body says so too).
What I checked: the new preset is picked up automatically, because elements/bluefin-server/os-sshd-preset.bst:7-10 imports the whole files/os/systemd/system-preset directory into /usr/lib/systemd/system-preset. The migration unit matches bluefin-update-status-migrate.service line for line (stamp, installed-only conditions, /usr wants link at elements/oci/bluefin-server-usr.bst:172-173). The helper symlink loop in os-host.bst, the helpers map and HOST_HELPERS all gain disable-unused-migrate.
correctness (low, advisory, see inline thread): an operator-masked unit makes systemctl preset fail, so the migration never writes its stamp and fails again on every boot.
No findings from: security, intent-alignment, style, docs-currency.
Confidence: 5/5 (safe)
-- hive: agent=reviewer backend=claude model=claude-opus-5-5 effort=medium claude=2.1.327
| stamp := h.Env("BLUEFIN_DISABLE_UNUSED_STAMP", Stamp) | ||
| failed := false | ||
| for _, unit := range Units { | ||
| if h.Exec(systemctl, "preset", "--now", unit) != 0 { |
There was a problem hiding this comment.
correctness (low, advisory): I could not test this against FSDK's systemd. If an operator has already masked one of these units (for example systemctl mask isnsd.socket for hardening), systemctl preset refuses it: systemd reports that the unit file is masked and exits non-zero. Every boot then marks this unit failed, writes no stamp (lines 36-39), and tries again. A masked unit is already off, which is what this migration wants, so it can count as done:
for _, unit := range Units {
+ // A masked unit is already off; preset refuses masked units.
+ if out, _ := h.Output(systemctl, "is-enabled", unit); strings.TrimSpace(out) == "masked" {
+ continue
+ }
if h.Exec(systemctl, "preset", "--now", unit) != 0 {Use whatever capture-output helper sys.Host provides; h.Output is a placeholder. Add a hosttest case where is-enabled prints masked. Check that the case still writes the stamp. Not blocking: the failure is noisy but harmless.
|
Hive status — updated in place; edits do not notify. Full history is in the Activity Monitor. Ready for a human merge: verdict approved The hive never approves on your behalf: approve and merge it on GitHub if you accept it. |
Danathar
left a comment
There was a problem hiding this comment.
Approving for Danathar. 80-bluefin-unused.preset disables isnsd (the iSNS server on TCP 3205, which the iSCSI initiator doesn't need) and systemd-homed (no homed users on this image).
The one-shot bluefin-disable-unused-migrate service applies just those four units with systemctl preset --now, so a node whose own preset enables one keeps it. It writes a stamp in /var only when every unit succeeds, and its conditions skip diskless and tmpfs-root nodes, whose first-boot presets already include the file. Tests cover the once-only stamp and retry-on-failure.
The hive's low, advisory thread (a unit an operator already masked would fail preset and retry every boot) is worth taking, but it isn't blocking: it's noisy, not harmful. jeefy merges.
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: Needs approval from an approver in each of these files:Approvers can indicate their approval by writing |
There was a problem hiding this comment.
Summary: This update teaches the one-time cleanup (which switches off two unneeded background services on servers that are already installed) to skip a service when this version of the system does not ship it, and to skip the very first boot, when the normal settings already take care of it. Both changes look right. One small gap: no test checks the new "skip a missing service" case, and the case depends on how the system's service manager reports "nothing found", which I could not confirm here.
Delta re-review of 7283e2c...6f6b57d (3 files, 10 lines).
Previous finding, re-checked:
- [correctness] masked unit makes the migration fail and retry every boot - still present, still advisory. The new guard at
unused.go:32does not cover it:systemctl list-unit-fileslists a masked unit with statemaskedand succeeds, sopreset --nowatunused.go:35still runs on it. The earlier inline thread stands. It does not block.
correctness (low, advisory)
unused.go:31-34 skips a unit when systemctl list-unit-files --no-legend <unit> exits non-zero. That needs FSDK's systemd to return failure when the pattern matches nothing. Older systemd printed 0 unit files listed. and exited 0. I had no systemd to check this against. If it exits 0, the guard never fires. A missing unit then falls through to preset, which fails, and the migration retries every boot. No test covers the skip path either: the fake in unused_test.go:14 returns 0 for every call. A test pins the intended behaviour:
+func TestMigrateSkipsUnitsThatAreNotInstalled(t *testing.T) {
+ stamp := filepath.Join(t.TempDir(), "stamp")
+ h := hosttest.New(map[string]string{"BLUEFIN_SYSTEMCTL": "sc", "BLUEFIN_DISABLE_UNUSED_STAMP": stamp}, func(argv []string) (string, int) {
+ if len(argv) >= 2 && argv[1] == "list-unit-files" && argv[len(argv)-1] == "systemd-homed-activate.service" {
+ return "", 1
+ }
+ return "", 0
+ })
+ if code := Migrate(h.Host, nil); code != 0 {
+ t.Fatalf("exit %d: %s", code, h.Err.String())
+ }
+ for _, c := range h.Fake.Calls() {
+ if c == "sc preset --now systemd-homed-activate.service" {
+ t.Errorf("preset ran on a unit that is not installed")
+ }
+ }
+ if _, err := os.Stat(stamp); err != nil {
+ t.Errorf("stamp: %v", err)
+ }
+}A full-build boot on an image without one of these units would confirm the exit code. Not blocking.
No findings from: security, intent-alignment, style, docs-currency.
Confidence: 5/5 (safe)
-- hive: agent=reviewer backend=claude model=claude-opus-5-5 effort=medium claude=2.1.327
castrojo
left a comment
There was a problem hiding this comment.
Reviewed diff and CI (18/18 green, stage/090-ready-for-human-merge). Approving and queuing.
Summary: Every server starts two background services it has no use for: an iSNS name server (
isnsd) that listens for network connections on port 3205 on all interfaces, and the systemd home-directory manager (systemd-homed). This switches both off, and switches them off on servers that are already installed, which a plain settings change would not reach.Why
FSDK's presets have no catch-all "disable *", so a unit with no preset line is enabled on first boot. The repo's own dogfood serial log shows it:
isnsdcomes from FSDK'sopen-isns, a dependency ofopen-iscsi(os-base.bst). It is the iSNS server. Its socket unit isListenStream=3205, so it listens on every interface. The iSCSI initiator in80-bluefin-iscsi.presetonly needsiscsid.systemd-homedmanages portable home directories. Root ships locked and accounts come from sysusers and Ignition. A grep offiles/,elements/,docs/andtests/finds nohomectl,pam_systemd_homeoruserdbuser.ddi-installer-build.mdsays disabling homed "would need a patch on FSDK's systemd element". That is about compiling it out. A preset only stops it starting, and the image already maskssystemd-homed-firstboot.service.What changes
80-bluefin-unused.presetdisablesisnsd.service,isnsd.socket,systemd-homed.serviceandsystemd-homed-activate.service. It sorts before FSDK's90-systemd.presetand after20-ignition.preset, whichtest_presets_sort_between_ignition_and_fsdk_defaultsalready enforces, so a node config can still enable either one.bluefin-disable-unused-migrate(a newbluefin-hosthelper,internal/host/unused) runssystemctl preset --nowon exactly those four units. The--nowalso stops them. A failed unit leaves no stamp, so the next boot retries. It follows thebluefin-update-status-migratepattern: enabled in/usr, once per node (stamp in/var/lib/bluefin), installed nodes only.kubeadm-sysext.md(the iSCSI section) notes it.Tests
systemctl --root preset-allwithenable *, thenpreset:enable isnsd.*preset in/etc: the units are enabled again.tests/unit/test_os_contracts.py: each of the four units is disabled by the preset and enabled by none, the migration unit and its/usrwiring, and a check that the helper's unit list equals the preset's.unused_test.go: the helper presets each unit once and only its own, and a failure writes no stamp.pytest -n auto: 1883 passed, 3 skipped.go vetandgo test -racepass. ruff, mypy anddocs-checks.pyare clean.just validatepasses.full-buildrun would show that the boot log no longer has those lines.This touches the same helper lists as #701 (
os-host.bst,bluefin-host/main.go,conftest.py), so whichever merges second needs a small rebase.🤖 Generated with Claude Code