aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorColin Percival <cperciva@FreeBSD.org>2022-07-13 00:42:26 +0000
committerColin Percival <cperciva@FreeBSD.org>2022-07-19 00:23:25 +0000
commit84ec7df0d796ddab6301817e12904762e2724c8e (patch)
tree41b03baadfe3ad5e6ae2807f87b4c7cb3d74a930
parent4e2121c10afc3d9273368eae776fe31d0c68ba6a (diff)
downloadsrc-84ec7df0d796.tar.gz
src-84ec7df0d796.zip
Add kern.reboot_wait_time sysctl
Historic FreeBSD behaviour (dating back to 1994-04-02) when rebooting is to print "Rebooting..." and then /* wait 1 sec for printf's to complete and be read */ Prior to April 1994, there was a 100 ms delay (added 1993-11-12). Since (a) most users will already be aware that the system is rebooting and do not need to take time to read an additional message to that effect, and (b) most FreeBSD systems don't have anyone actively looking at the console anyway, this delay no longer serves much purpose. This commit adds a kern.reboot_wait_time sysctl which defaults to 0; historic behaviour can be regained by setting it to 1. Reviewed by: imp Relnotes: FreeBSD now reboots faster; to restore the traditional wait after printing "Rebooting..." to the console, set kern.reboot_wait_time=1 (or more). Sponsored by: https://www.patreon.com/cperciva Differential Revision: https://reviews.freebsd.org/D35796
-rw-r--r--sys/kern/kern_shutdown.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/sys/kern/kern_shutdown.c b/sys/kern/kern_shutdown.c
index 87afc175a72d..ab37b54667f9 100644
--- a/sys/kern/kern_shutdown.c
+++ b/sys/kern/kern_shutdown.c
@@ -111,6 +111,10 @@ static int panic_reboot_wait_time = PANIC_REBOOT_WAIT_TIME;
SYSCTL_INT(_kern, OID_AUTO, panic_reboot_wait_time, CTLFLAG_RWTUN,
&panic_reboot_wait_time, 0,
"Seconds to wait before rebooting after a panic");
+static int reboot_wait_time = 0;
+SYSCTL_INT(_kern, OID_AUTO, reboot_wait_time, CTLFLAG_RWTUN,
+ &reboot_wait_time, 0,
+ "Seconds to wait before rebooting");
/*
* Note that stdarg.h and the ANSI style va_start macro is used for both
@@ -710,7 +714,7 @@ shutdown_reset(void *junk, int howto)
{
printf("Rebooting...\n");
- DELAY(1000000); /* wait 1 sec for printf's to complete and be read */
+ DELAY(reboot_wait_time * 1000000);
/*
* Acquiring smp_ipi_mtx here has a double effect: