Page MenuHomeFreeBSD

D13042.diff
No OneTemporary

D13042.diff

Index: head/sys/kern/kern_shutdown.c
===================================================================
--- head/sys/kern/kern_shutdown.c
+++ head/sys/kern/kern_shutdown.c
@@ -134,6 +134,14 @@
SYSCTL_INT(_kern, OID_AUTO, sync_on_panic, CTLFLAG_RWTUN,
&sync_on_panic, 0, "Do a sync before rebooting from a panic");
+static bool poweroff_on_panic = 0;
+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");
+
+static bool powercycle_on_panic = 0;
+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 SYSCTL_NODE(_kern, OID_AUTO, shutdown, CTLFLAG_RW, 0,
"Shutdown environment");
@@ -797,6 +805,10 @@
/* thread_unlock(td); */
if (!sync_on_panic)
bootopt |= RB_NOSYNC;
+ if (poweroff_on_panic)
+ bootopt |= RB_POWEROFF;
+ if (powercycle_on_panic)
+ bootopt |= RB_POWERCYCLE;
kern_reboot(bootopt);
}
Index: head/tools/tools/sysdoc/tunables.mdoc
===================================================================
--- head/tools/tools/sysdoc/tunables.mdoc
+++ head/tools/tools/sysdoc/tunables.mdoc
@@ -1035,6 +1035,20 @@
This is a read-only variable.
---
+kern.powercycle_on_panic
+bool
+
+In the event of a panic, this variable controls whether or not the
+system should try to power cycle instead of rebooting.
+
+---
+kern.poweroff_on_panic
+bool
+
+In the event of a panic, this variable controls whether or not the
+system should try to power off instead of rebooting.
+
+---
kern.proc.all
---

File Metadata

Mime Type
text/plain
Expires
Thu, Apr 9, 11:53 PM (7 h, 59 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
31179502
Default Alt Text
D13042.diff (1 KB)

Event Timeline