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.
This commit is contained in:
parent
ceff78b6b6
commit
9f9f4d4e3f
|
@ -218,10 +218,12 @@ graphics resolution (see
|
||||||
.Sh EXIT STATUS
|
.Sh EXIT STATUS
|
||||||
.Nm
|
.Nm
|
||||||
exits 0 if the kernel should power off, exits 1 if the kernel should reboot, or
|
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
|
Any other exit by the initial
|
||||||
.Nm
|
.Nm
|
||||||
will trigger a kernel panic.
|
will cause the kernel to halt with a complaint about an unexpected exit code.
|
||||||
.Nm
|
.Nm
|
||||||
exits with the same exit status as its target session if it terminates normally.
|
exits with the same exit status as its target session if it terminates normally.
|
||||||
.Sh SEE ALSO
|
.Sh SEE ALSO
|
||||||
|
|
|
@ -666,7 +666,10 @@ static void BootThread(void* /*user*/)
|
||||||
Log::Sync();
|
Log::Sync();
|
||||||
HaltKernel();
|
HaltKernel();
|
||||||
default:
|
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
|
The computer is powered off if the
|
||||||
.Nm init
|
.Nm init
|
||||||
process exits 0, rebooted if it exits 1,
|
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
|
.Pp
|
||||||
The options are as follows:
|
The options are as follows:
|
||||||
.Bl -tag -width "12345678"
|
.Bl -tag -width "12345678"
|
||||||
|
|
Loading…
Reference in New Issue