Repository navigation
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. |
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