feat: say whether a host is still in its first boot #6

Merged
christianmanivong merged 1 commits from feat/first-boot-pending into main 2026-10-08 11:01:34 +00:00
Owner

first_boot_pending() is true while /firstboot exists on FreeBSD.

On its first boot, a FreeBSD cloud image starts the guest agent (so the hypervisor already reports the IP), then upgrades its base system (110 packages on 15.1), only then starts sshd, and restarts within the same second. /etc/rc removes /firstboot just before that restart. This was recorded on the console of a fresh 15.1 cloud image (NetOrk/netork#793).

netOrk's VM bootstrap waits for this before it updates the new VM and sets up SNMP (NetOrk/netork#795). Otherwise a VM in the middle of its first-boot upgrade would get pkg runs of its own, and then a restart.

OpenBSD has no such marker to ask yet, so there it returns False and runs nothing.

README and CHANGELOG are updated.

`first_boot_pending()` is true while `/firstboot` exists on FreeBSD. On its first boot, a FreeBSD cloud image starts the guest agent (so the hypervisor already reports the IP), then upgrades its base system (110 packages on 15.1), only then starts sshd, and restarts within the same second. `/etc/rc` removes `/firstboot` just before that restart. This was recorded on the console of a fresh 15.1 cloud image (NetOrk/netork#793). netOrk's VM bootstrap waits for this before it updates the new VM and sets up SNMP (NetOrk/netork#795). Otherwise a VM in the middle of its first-boot upgrade would get `pkg` runs of its own, and then a restart. OpenBSD has no such marker to ask yet, so there it returns `False` and runs nothing. README and CHANGELOG are updated.
christianmanivong added 1 commit 2026-10-08 10:58:08 +00:00
feat: say whether a host is still in its first boot
CI / test (3.10) (push) Successful in 29s
CI / test (3.11) (push) Successful in 30s
CI / test (3.12) (push) Successful in 29s
CI / test (3.10) (pull_request) Successful in 29s
CI / test (3.11) (pull_request) Successful in 46s
CI / test (3.12) (pull_request) Successful in 42s
32a63411d3
first_boot_pending() is true while /firstboot exists on FreeBSD. A FreeBSD
cloud image upgrades its base system on its first boot, starts sshd only
after that and restarts right away, and /etc/rc removes /firstboot just
before that restart. netOrk waits for this before it sets up a new VM
(NetOrk/netork#795).

OpenBSD has no such marker to ask yet, so it returns False there.
christianmanivong merged commit 2a92ec77e3 into main 2026-10-08 11:01:34 +00:00
christianmanivong deleted branch feat/first-boot-pending 2026-10-08 11:01:35 +00:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: NAPALM/napalm-bsd#6