From owner-svn-src-all@freebsd.org Tue Nov 14 19:06:31 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 677A9DDB37C; Tue, 14 Nov 2017 19:06:31 +0000 (UTC) (envelope-from ronald-lists@klop.ws) Received: from smarthost1.greenhost.nl (smarthost1.greenhost.nl [195.190.28.92]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2FA3C6B88B; Tue, 14 Nov 2017 19:06:30 +0000 (UTC) (envelope-from ronald-lists@klop.ws) Received: from smtp.greenhost.nl ([213.108.104.138]) by smarthost1.greenhost.nl with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1eEgIB-00005O-JN; Tue, 14 Nov 2017 19:50:39 +0100 Content-Type: text/plain; charset=iso-8859-15; format=flowed; delsp=yes To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, "Warner Losh" Subject: Re: svn commit: r325785 - in head: sys/kern tools/tools/sysdoc References: <201711140029.vAE0TEVO024994@repo.freebsd.org> Date: Tue, 14 Nov 2017 19:50:33 +0100 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: "Ronald Klop" Message-ID: In-Reply-To: <201711140029.vAE0TEVO024994@repo.freebsd.org> User-Agent: Opera Mail/1.0 (Win32) X-Authenticated-As-Hash: bdb49c4ff80bd276e321aade33e76e02752072e2 X-Virus-Scanned: by clamav at smarthost1.samage.net X-Spam-Level: / X-Spam-Score: -0.2 X-Spam-Status: No, score=-0.2 required=5.0 tests=ALL_TRUSTED, BAYES_50 autolearn=disabled version=3.4.0 X-Scan-Signature: 22b714be0c51703cd3047a81d17f7b3c X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Nov 2017 19:06:31 -0000 Just out of curiosity. What happens if you enable both? Regards, Ronald. On Tue, 14 Nov 2017 01:29:14 +0100, Warner Losh wrote: > Author: imp > Date: Tue Nov 14 00:29:14 2017 > New Revision: 325785 > URL: https://svnweb.freebsd.org/changeset/base/325785 > > Log: > Add two new tunables / sysctls to controll reboot after panic: > kern.poweroff_on_panic which, when enabled, instructs a system to > power off on a panic instead of a reboot. > kern.powercyle_on_panic which, when enabled, instructs a system to > power cycle, if possible, on a panic instead of a reboot. > Sponsored by: Netflix > Differential Revision: https://reviews.freebsd.org/D13042 > > Modified: > head/sys/kern/kern_shutdown.c > head/tools/tools/sysdoc/tunables.mdoc > > Modified: head/sys/kern/kern_shutdown.c > ============================================================================== > --- head/sys/kern/kern_shutdown.c Mon Nov 13 23:33:07 2017 (r325784) > +++ head/sys/kern/kern_shutdown.c Tue Nov 14 00:29:14 2017 (r325785) > @@ -134,6 +134,14 @@ static int sync_on_panic = 0; > 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 @@ vpanic(const char *fmt, va_list ap) > /* 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); > } > > Modified: head/tools/tools/sysdoc/tunables.mdoc > ============================================================================== > --- head/tools/tools/sysdoc/tunables.mdoc Mon Nov 13 23:33:07 > 2017 (r325784) > +++ head/tools/tools/sysdoc/tunables.mdoc Tue Nov 14 00:29:14 > 2017 (r325785) > @@ -1035,6 +1035,20 @@ is attempting to comply with. > 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 > --- > _______________________________________________ > svn-src-all@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-all > To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"