svn commit: r260433 - stable/9/sys/kern
Colin Percival
cperciva at FreeBSD.org
Wed Jan 8 02:31:36 UTC 2014
Author: cperciva
Date: Wed Jan 8 02:31:35 2014
New Revision: 260433
URL: http://svnweb.freebsd.org/changeset/base/260433
Log:
MFC r258893, r258956:
Add a new sysctl / loader tunable kern.panic_reboot_wait_time which
defaults to PANIC_REBOOT_WAIT_TIME (a long-existing kernel config
setting). Use this now-variable value in place of the defined constant
to control how long the system waits after a panic before rebooting.
Modified:
stable/9/sys/kern/kern_shutdown.c
Directory Properties:
stable/9/sys/ (props changed)
Modified: stable/9/sys/kern/kern_shutdown.c
==============================================================================
--- stable/9/sys/kern/kern_shutdown.c Wed Jan 8 02:30:24 2014 (r260432)
+++ stable/9/sys/kern/kern_shutdown.c Wed Jan 8 02:31:35 2014 (r260433)
@@ -87,6 +87,11 @@ __FBSDID("$FreeBSD$");
#ifndef PANIC_REBOOT_WAIT_TIME
#define PANIC_REBOOT_WAIT_TIME 15 /* default to 15 seconds */
#endif
+static int panic_reboot_wait_time = PANIC_REBOOT_WAIT_TIME;
+SYSCTL_INT(_kern, OID_AUTO, panic_reboot_wait_time, CTLFLAG_RW | CTLFLAG_TUN,
+ &panic_reboot_wait_time, 0,
+ "Seconds to wait before rebooting after a panic");
+TUNABLE_INT("kern.panic_reboot_wait_time", &panic_reboot_wait_time);
/*
* Note that stdarg.h and the ANSI style va_start macro is used for both
@@ -487,12 +492,12 @@ shutdown_panic(void *junk, int howto)
int loop;
if (howto & RB_DUMP) {
- if (PANIC_REBOOT_WAIT_TIME != 0) {
- if (PANIC_REBOOT_WAIT_TIME != -1) {
+ if (panic_reboot_wait_time != 0) {
+ if (panic_reboot_wait_time != -1) {
printf("Automatic reboot in %d seconds - "
"press a key on the console to abort\n",
- PANIC_REBOOT_WAIT_TIME);
- for (loop = PANIC_REBOOT_WAIT_TIME * 10;
+ panic_reboot_wait_time);
+ for (loop = panic_reboot_wait_time * 10;
loop > 0; --loop) {
DELAY(1000 * 100); /* 1/10th second */
/* Did user type a key? */
More information about the svn-src-stable-9
mailing list