fix: no first boot screen is drawn when nobody can answer the console #47

Merged
navigator merged 1 commit from fix/dialog-unattended into master 2026-10-15 18:44:54 -03:00
Owner

keel#155, item 6: on a reboot, the first boot inithooks of a PostgreSQL container ran again.

Cause, reproduced on a new CT on BR1: a hook drew a screen on a console that nobody reads (35pgsqlpass of common's pgsql overlay, with no DB_PASS). The first boot waited there for ever, 98finalize did not run and RUN_FIRSTBOOT stayed true. Each reboot ran every first boot hook again: new SSH host keys, and 29sudoadmin changed the root password state.

common#55 fixes that hook. This PR stops the same failure in any other hook: run exports INITHOOKS_UNATTENDED, and the Dialog of libinithooks/dialog_wrapper.py now raises an error with that reason before it draws a widget. The hook fails, run logs it and goes on, and the first boot ends. With INITHOOKS_UNATTENDED=no or unset, nothing changes.

Tests: written first, TestNobodyCanAnswer in tests/test_dialog_wrapper.py. Changelog: 2.3.6+keel26.

keel#155, item 6: on a reboot, the first boot inithooks of a PostgreSQL container ran again. Cause, reproduced on a new CT on BR1: a hook drew a screen on a console that nobody reads (`35pgsqlpass` of common's pgsql overlay, with no `DB_PASS`). The first boot waited there for ever, `98finalize` did not run and `RUN_FIRSTBOOT` stayed `true`. Each reboot ran every first boot hook again: new SSH host keys, and `29sudoadmin` changed the root password state. common#55 fixes that hook. This PR stops the same failure in any other hook: `run` exports `INITHOOKS_UNATTENDED`, and the `Dialog` of `libinithooks/dialog_wrapper.py` now raises an error with that reason before it draws a widget. The hook fails, `run` logs it and goes on, and the first boot ends. With `INITHOOKS_UNATTENDED=no` or unset, nothing changes. Tests: written first, `TestNobodyCanAnswer` in `tests/test_dialog_wrapper.py`. Changelog: 2.3.6+keel26.
fix: no first boot screen is drawn when nobody can answer the console
All checks were successful
security / security (pull_request) Successful in 1m3s
tests / python (pull_request) Successful in 38s
tests / package (pull_request) Successful in 6s
tests / tests (pull_request) Successful in 5m13s
e2c6d69c87
A hook that drew a screen on a console that nobody reads waited for
ever. The first boot never reached 98finalize, and each reboot ran the
first boot hooks again (keel#155, item 6). The Dialog wrapper now raises
an error with the reason from INITHOOKS_UNATTENDED, so the hook fails,
run logs it and the first boot ends.
navigator merged commit 4257b48222 into master 2026-10-15 18:44:54 -03:00
Sign in to join this conversation.
No description provided.