Registry Mirror
Skip to content

Conversation

@jeefy

@jeefy jeefy commented Nov 20, 2026

Copy link
Copy Markdown
Collaborator

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:

[  OK  ] Listening on isnsd.socket.
[  OK  ] Started iSNS daemon.
         Starting Home Area Manager...
[  OK  ] Started Home Area Manager.
  • isnsd comes from FSDK's open-isns, a dependency of open-iscsi (os-base.bst). It is the iSNS server. Its socket unit is ListenStream=3205, so it listens on every interface. The iSCSI initiator in 80-bluefin-iscsi.preset only needs iscsid.
  • systemd-homed manages portable home directories. Root ships locked and accounts come from sysusers and Ignition. A grep of files/, elements/, docs/ and tests/ finds no homectl, pam_systemd_home or userdb user. ddi-installer-build.md says 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 masks systemd-homed-firstboot.service.

What changes

  • 80-bluefin-unused.preset disables isnsd.service, isnsd.socket, systemd-homed.service and systemd-homed-activate.service. It sorts before FSDK's 90-systemd.preset and after 20-ignition.preset, which test_presets_sort_between_ignition_and_fsdk_defaults already enforces, so a node config can still enable either one.
  • Presets apply on first boot only, so installed nodes would keep both running. bluefin-disable-unused-migrate (a new bluefin-host helper, internal/host/unused) runs systemctl preset --now on exactly those four units. The --now also stops them. A failed unit leaves no stamp, so the next boot retries. It follows the bluefin-update-status-migrate pattern: enabled in /usr, once per node (stamp in /var/lib/bluefin), installed nodes only.
  • kubeadm-sysext.md (the iSCSI section) notes it.

Tests

  • A Fedora 44 container run of systemctl --root preset-all with enable *, then preset:
    • before the preset file: 4 enable links, as in the boot log;
    • after the migration: 0 links;
    • with an Ignition-style enable isnsd.* preset in /etc: the units are enabled again.
  • New in 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 /usr wiring, 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 vet and go test -race pass. ruff, mypy and docs-checks.py are clean. just validate passes.
  • Not run: the image build and a QEMU boot. A full-build run 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

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>
@jeefy
jeefy requested review from bketelsen and daegalus November 20, 2026 04:43
@jeefy

jeefy commented Nov 20, 2026

Copy link
Copy Markdown
Collaborator Author

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
To complete the pull request process, please assign ahmedadan after the PR has been reviewed.
You can assign the PR to them by writing /assign @ahmedadan in a comment when ready.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@hivecommons-hive hivecommons-hive Bot added author/human A person pushed this PR themselves no-dco A commit is missing Signed-off-by — run `git rebase --signoff` role/untrusted Author has no registry profile or verified hive claim (or is revoked); never auto-merged stage/050-review-pending Review swarm requested; awaiting a verdict for the current head labels Nov 20, 2026

@hivecommons-hive hivecommons-hive Bot 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.

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 {

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.

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.

@hivecommons-hive hivecommons-hive Bot added stage/060-reviewed Review swarm verdict approve; a gate is still pending (CI running, soak not started) stage/090-ready-for-human-merge Hive would merge this but trust/role blocks it; a maintainer's /lgtm /approve is all that is missing and removed stage/050-review-pending Review swarm requested; awaiting a verdict for the current head stage/060-reviewed Review swarm verdict approve; a gate is still pending (CI running, soak not started) labels Nov 20, 2026
@hivecommons-hive

hivecommons-hive Bot commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

Hive status — updated in place; edits do not notify. Full history is in the Activity Monitor.

Ready for a human merge: verdict approved 6f6b57d, 18/18 checks green, soak 30m0s elapsed. Blocked only by role/untrusted (no verified hive claim or registry tier).

The hive never approves on your behalf: approve and merge it on GitHub if you accept it.

@hivecommons-hive hivecommons-hive Bot added stage/060-reviewed Review swarm verdict approve; a gate is still pending (CI running, soak not started) stage/090-ready-for-human-merge Hive would merge this but trust/role blocks it; a maintainer's /lgtm /approve is all that is missing and removed stage/090-ready-for-human-merge Hive would merge this but trust/role blocks it; a maintainer's /lgtm /approve is all that is missing stage/060-reviewed Review swarm verdict approve; a gate is still pending (CI running, soak not started) labels Nov 20, 2026
@jeefy
jeefy added this pull request to the merge queue Nov 21, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Nov 21, 2026
@jeefy
jeefy added this pull request to the merge queue Nov 22, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Nov 22, 2026
Danathar
Danathar previously approved these changes Nov 25, 2026

@Danathar Danathar 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.

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.

@castrojo
castrojo added this pull request to the merge queue Nov 26, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Nov 26, 2026
@jeefy

jeefy commented Nov 26, 2026

Copy link
Copy Markdown
Collaborator Author

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
To complete the pull request process, please assign ahmedadan after the PR has been reviewed.
You can assign the PR to them by writing /assign @ahmedadan in a comment when ready.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@hivecommons-hive hivecommons-hive Bot removed the stage/090-ready-for-human-merge Hive would merge this but trust/role blocks it; a maintainer's /lgtm /approve is all that is missing label Nov 26, 2026
@hivecommons-hive hivecommons-hive Bot added the stage/050-review-pending Review swarm requested; awaiting a verdict for the current head label Nov 26, 2026

@hivecommons-hive hivecommons-hive Bot 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.

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:32 does not cover it: systemctl list-unit-files lists a masked unit with state masked and succeeds, so preset --now at unused.go:35 still 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

@hivecommons-hive hivecommons-hive Bot added stage/060-reviewed Review swarm verdict approve; a gate is still pending (CI running, soak not started) stage/stalled In its current stage longer than expected stage/090-ready-for-human-merge Hive would merge this but trust/role blocks it; a maintainer's /lgtm /approve is all that is missing and removed stage/050-review-pending Review swarm requested; awaiting a verdict for the current head stage/060-reviewed Review swarm verdict approve; a gate is still pending (CI running, soak not started) stage/stalled In its current stage longer than expected stage/090-ready-for-human-merge Hive would merge this but trust/role blocks it; a maintainer's /lgtm /approve is all that is missing labels Nov 26, 2026

@castrojo castrojo 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.

Reviewed diff and CI (18/18 green, stage/090-ready-for-human-merge). Approving and queuing.

@castrojo
castrojo added this pull request to the merge queue Nov 28, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Nov 28, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author/human A person pushed this PR themselves no-dco A commit is missing Signed-off-by — run `git rebase --signoff` role/untrusted Author has no registry profile or verified hive claim (or is revoked); never auto-merged stage/090-ready-for-human-merge Hive would merge this but trust/role blocks it; a maintainer's /lgtm /approve is all that is missing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants