Repository navigation
fix: a first boot finishes without a journal and without a watcher - #38
Merged
Merged
Conversation
Two stalls of the published core 19.0-6 booted headless (BR2, 2026-10-03; CI's boot-published-layer fails on them). 15regen-sslcert exited 1 before doing anything: under bash -e its log() called logger, which fails with "socket /dev/log: Connection refused" when journald is down (status=243/CREDENTIALS in the CI container, the host's AppArmor profile denying the ramfs mount systemd 257 makes for credentials), and the first info line killed the hook. Its logger may not fail it now, nor may 95secupdates', the one other hook that logs under -e; the other hooks and libs do not call logger, and run's own log() was tolerant already. The first boot stalled after [30turnkey-init-fence] running when nobody was attached to the container console: run's notice() drew a dialog infobox on tty1 for every hook, tty1 in LXC is a pty whose master only an attached console reads, and after about 30 KB the write blocked in n_tty_write for good. A console with no size (stty answers 0 0 on an unattended LXC tty; a VT or an attached console answers its rows and columns) gets no notice, and a notice the console does not take within NOTICE_TIMEOUT (2 s, timeout --foreground) is given up with the ones after it, so no boot can wedge on its console. Each is said once in the inithooks log and the journal.
marcos-mendez
force-pushed
the
fix/first-boot-without-journal-or-console
branch
from
October 3, 2026 04:05
2d1bbf3 to
ae89636
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two stalls of the published core 19.0-6 booted headless (BR2, 2026-10-03), the ones CI's boot-published-layer fails on.
1. Hooks that die when journald is down.
15regen-sslcertruns underbash -eand itslog()calledlogger, which fails with "socket /dev/log: Connection refused" when journald is down (in the CI container it dies with status=243/CREDENTIALS: the host's AppArmor profile denies the ramfs mount systemd 257 makes for credentials; Keel-Linux/handbook PR to follow). The firstinfokilled the hook before it made the certificate. Itsloggeris nowlogger ... 2>/dev/null || true, the shaperun'slog()and keel's10keel-systemuse. Audit of every hook and lib for-e+logger:95secupdateswas the other one (nine calls, now through onejournal()with the same shape);30turnkey-init-fenceandbin/keel-host-keyscall logger without-e; no lib calls it.2. Notices that wedge an unattended boot.
run'snotice()drewdialog --infoboxon tty1 for every hook (keel17); in LXC tty1 is a pty whose master onlypct console/lxc-consolereads, so with nobody attached the writes filled the buffer and blocked for good after30turnkey-init-fence. Now: a console with no size (stty sizeanswers0 0on an unattended LXC tty; a VT or an attached console answers rows and columns) gets no notice; a notice the console does not take withinNOTICE_TIMEOUT(2 s,timeout --foregroundso dialog keeps the terminal's process group) is given up with the ones after it. Each case, and output that is not a terminal, is said once in the inithooks log and the journal ("first boot notices not drawn: ..."), so an operator can tell why the screen stayed still.confconsole --usageat the end of the run is unchanged: it is interactive and the boot is over by then.Tested.
tests/test-regen-sslcert.bats(8, new; the hook is measured for the first time, 27/27) withloggerexiting 1; three tests intest-secupdates.batswithloggerfailing;test-run.bats: the terminal tests now run on a sized pty, an unsized pty gets no notice and the log line, and a sized pty whose master is never read (pythonpty.openpty, dialog a stub writing more than the pty holds) finishes with all hooks run and the timeout said. 322 bats, shell 99.64 (COVERAGE.md).