Skip to content

fix(os): stop enabling the iSNS server and systemd-homed - #702

Open
jeefy wants to merge 1 commit into
projectbluefin:mainfrom
jeefy:fix/disable-isnsd-homed
Open

jeefy wants to merge 1 commit into
projectbluefin:mainfrom
jeefy:fix/disable-isnsd-homed

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

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 7283e2c, 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

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.

1 participant