Repository navigation
fix(console): show a branded screen on reboot and shutdown - #366
Merged
Merged
Conversation
The boot sequence has had a branded mark and version banner since PID 1 was written, but nothing wrote to the console when a node tore down: the dashboard just froze on its last frame through the whole teardown, then went blank as the kernel restarted or powered off, with no sign of what was happening. Wait now announces the chosen action to the console as soon as it is picked, clearing the screen and showing the mark with "Rebooting..." or "Shutting down...", the same style as the boot banner. The teardown watchdog announces again right before it forces a halt, in case the hung teardown left the dashboard redrawing over the first message. README.md documents the new screen alongside the shutdown paths it covers. Signed-off-by: Bugs5382 <12115015+Bugs5382@users.noreply.github.com>
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.
What and why
internal/console.Rendererdraws the branded mark and version banner duringBoot(), but nothing wrote to the console on the way down: the shutdown andreboot paths (
internal/init/shutdown.go,shutdown_linux.go) only logged to/dev/kmsg, so the dashboard just froze on its last frame through the wholeteardown and then went blank as the kernel restarted or powered off, with
nothing telling the admin what was happening.
shutdownRequests.Waitnow announces the chosen action to the console assoon as it is picked (clears the screen, then the mark with "Rebooting..." or
"Shutting down...", matching the boot banner's style), before arming the
teardown watchdog. The watchdog's
forceHaltannounces again right before itforces a halt, since a hung teardown could leave the dashboard supervisor
redrawing over the first message in the meantime.
README.md gets a line noting the new screen next to the shutdown paths it
already documents.
Testing
TestRendererShutdown(console package): clears the screen, includesthe boot banner, ends with the message.
TestShutdownAction_ConsoleMessageandTestShutdownRequests_WaitAnnouncesTheAction(init package): the actionmaps to the right wording, and
Waitcalls the announce hook beforereturning.
testShutdownRequestsnow also stubs the announce hook, the same reason italready stubs the watchdog: the real one opens
/dev/console.go test ./...,go vet ./...,gofmt -l .all clean.Closes #363