Changeset View
Changeset View
Standalone View
Standalone View
sys/kern/kern_shutdown.c
Show First 20 Lines • Show All 158 Lines • ▼ Show 20 Lines | |||||
static bool poweroff_on_panic = 0; | static bool poweroff_on_panic = 0; | ||||
SYSCTL_BOOL(_kern, OID_AUTO, poweroff_on_panic, CTLFLAG_RWTUN, | SYSCTL_BOOL(_kern, OID_AUTO, poweroff_on_panic, CTLFLAG_RWTUN, | ||||
&poweroff_on_panic, 0, "Do a power off instead of a reboot on a panic"); | &poweroff_on_panic, 0, "Do a power off instead of a reboot on a panic"); | ||||
static bool powercycle_on_panic = 0; | static bool powercycle_on_panic = 0; | ||||
SYSCTL_BOOL(_kern, OID_AUTO, powercycle_on_panic, CTLFLAG_RWTUN, | SYSCTL_BOOL(_kern, OID_AUTO, powercycle_on_panic, CTLFLAG_RWTUN, | ||||
&powercycle_on_panic, 0, "Do a power cycle instead of a reboot on a panic"); | &powercycle_on_panic, 0, "Do a power cycle instead of a reboot on a panic"); | ||||
static bool reboot_on_halt = 0; | |||||
SYSCTL_BOOL(_kern, OID_AUTO, reboot_on_halt, CTLFLAG_RWTUN, | |||||
&reboot_on_halt, 0, "Reboot instead of halting or powering off"); | |||||
static SYSCTL_NODE(_kern, OID_AUTO, shutdown, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, | static SYSCTL_NODE(_kern, OID_AUTO, shutdown, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, | ||||
"Shutdown environment"); | "Shutdown environment"); | ||||
#ifndef DIAGNOSTIC | #ifndef DIAGNOSTIC | ||||
static int show_busybufs; | static int show_busybufs; | ||||
#else | #else | ||||
static int show_busybufs = 1; | static int show_busybufs = 1; | ||||
#endif | #endif | ||||
▲ Show 20 Lines • Show All 325 Lines • ▼ Show 20 Lines | #if defined(SMP) | ||||
} | } | ||||
#endif | #endif | ||||
/* We're in the process of rebooting. */ | /* We're in the process of rebooting. */ | ||||
rebooting = 1; | rebooting = 1; | ||||
reboottrace(howto); | reboottrace(howto); | ||||
/* We are out of the debugger now. */ | /* We are out of the debugger now. */ | ||||
kdb_active = 0; | kdb_active = 0; | ||||
if (((howto & (RB_HALT | RB_POWEROFF)) != 0 && reboot_on_halt) { | |||||
howto &= ~(RB_HALT | RB_POWEROFF); | |||||
howto |= RB_AUTOBOOT; | |||||
} | |||||
/* | /* | ||||
* Do any callouts that should be done BEFORE syncing the filesystems. | * Do any callouts that should be done BEFORE syncing the filesystems. | ||||
*/ | */ | ||||
EVENTHANDLER_INVOKE(shutdown_pre_sync, howto); | EVENTHANDLER_INVOKE(shutdown_pre_sync, howto); | ||||
BOOTTRACE("shutdown pre sync complete"); | BOOTTRACE("shutdown pre sync complete"); | ||||
/* | /* | ||||
▲ Show 20 Lines • Show All 1,323 Lines • Show Last 20 Lines |