Index: sys/kern/kern_shutdown.c =================================================================== --- sys/kern/kern_shutdown.c +++ sys/kern/kern_shutdown.c @@ -164,6 +164,10 @@ 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"); +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, "Shutdown environment"); @@ -506,6 +510,11 @@ /* We are out of the debugger now. */ 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. */