Commit 9f9f4d4e authored by Jonas Termansen's avatar Jonas Termansen

Print an kernel error rather than panicing if init(8) exits abnormally.

This avoids the misimpression that a kernel bug happened and it avoids
clearing the screen of potentially useful information about an init(8)
crash.
parent ceff78b6
......@@ -218,10 +218,12 @@ graphics resolution (see
.Sh EXIT STATUS
.Nm
exits 0 if the kernel should power off, exits 1 if the kernel should reboot, or
exits 2 if the boot failed and the kernel should halt.
exits 2 if the boot failed and the kernel should halt with a complaint about an
.Nm
fatality.
Any other exit by the initial
.Nm
will trigger a kernel panic.
will cause the kernel to halt with a complaint about an unexpected exit code.
.Nm
exits with the same exit status as its target session if it terminates normally.
.Sh SEE ALSO
......
......@@ -666,7 +666,10 @@ static void BootThread(void* /*user*/)
Log::Sync();
HaltKernel();
default:
PanicF("Init returned with unexpected return code %i", status);
Log::PrintF("kernel: fatal: init exited with unexpected exit code %i\n",
status);
Log::Sync();
HaltKernel();
}
}
......
......@@ -39,7 +39,10 @@ delimiter to stop kernel option parsing.
The computer is powered off if the
.Nm init
process exits 0, rebooted if it exits 1,
halted if it exits 2, and paniced otherwise.
halted with an complaint about an
.Nm init
fatality if it exits 2, and halted with a complaint about an unexpected exit code
otherwise.
.Pp
The options are as follows:
.Bl -tag -width "12345678"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment