From owner-svn-src-head@freebsd.org Tue Nov 14 19:18:19 2017 Return-Path: Delivered-To: svn-src-head@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 B41F6DDB695 for ; Tue, 14 Nov 2017 19:18:19 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x22a.google.com (mail-it0-x22a.google.com [IPv6:2607:f8b0:4001:c0b::22a]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 76A416BE94 for ; Tue, 14 Nov 2017 19:18:19 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x22a.google.com with SMTP id m191so14964917itg.2 for ; Tue, 14 Nov 2017 11:18:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=unL8XMZmBL/dXpXkMAcvFUSnBZQ9B9eiMZkzag43SKg=; b=SFzr2RHr9J/NvTjJcbjQpx6rW7/fpbnW4WF0TNAhQ8vBg8oPYfX38H3kwTgOAkdUkO rsMnEPqK5PvjGO8xPMdC10IoAPLjVYblxxpcUz+2FeS6yatIW2yyZ76vej8aBXZI1B28 emHrEWjT0nplnLkcES9yN1Vem/0XZBPuvTUbUrLZl8PgeQVW4TLlMf4rSc9zYDOTDGOd K1Twn0XEumnBUikba8MMMbcE61xS9X4/RPNjYcSv+nJtoK+qVk9A5sJncBt3R/gDvmCG NNaRTYbW5aWOhRb4NnAEkCNASrq9a18JZVpDigJgNRP0lR3o3ZNp/UbslSYaWNOQi0J7 JyKg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=unL8XMZmBL/dXpXkMAcvFUSnBZQ9B9eiMZkzag43SKg=; b=ARigCWqcyNCzYxtGIf1cFHaGe7mVnxmtluUFdoV3m8Yy6iOC12LFMrddFCryFVd/k0 6jbV52qnZoOBQtPm+lyvri/WAXpMWCKQGBr4VXtPXmKj5GmSC4nH++ViNGIHpvirrhsC 3gJuBrkXNj+JAC/V7CZUr0MLun2IAYx3bVd3kYHO2HCuEPDSaGFiiJaZKmj2JF+jdBgw qz+Rw2loFTYV6b7gRWe6sGTuhkNSFFwGa6uYTkpOEvBYz31hWnNCfvGnsc5Q4EBYKNi3 4HtFGBlJ0nWhFPYm8SZxWNY1pzXF5TVYx4ze3SiljK5wnoLFfXaVY9XSv0G/Mn9StsX6 jVwg== X-Gm-Message-State: AJaThX7zI6OwXnFqrWfrBjcy08BL73fRAXTyHbOj9O7GrDurkiVLi8qs 4k7wZbGZV5pvn5sDg6DUieoWmi4m6EStyAotJytuKA== X-Google-Smtp-Source: AGs4zMbw4xhz9teXp9UR7Rg+CCS4SaH+JjVtKF5ScO+xuyRTWc71kdy5vlbU7ntOMB94vI4Xl+pXbFw+8zKL/FNm1j4= X-Received: by 10.36.184.5 with SMTP id m5mr17198688ite.69.1510687098352; Tue, 14 Nov 2017 11:18:18 -0800 (PST) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.108.204 with HTTP; Tue, 14 Nov 2017 11:18:17 -0800 (PST) X-Originating-IP: [50.253.109.65] In-Reply-To: References: <201711140029.vAE0TEVO024994@repo.freebsd.org> From: Warner Losh Date: Tue, 14 Nov 2017 12:18:17 -0700 X-Google-Sender-Auth: y6bIJWW2GkE9J8t4oTRBFqO0MJ4 Message-ID: Subject: Re: svn commit: r325785 - in head: sys/kern tools/tools/sysdoc To: Ronald Klop Cc: src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" , Warner Losh Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Nov 2017 19:18:19 -0000 As implemented today, the power cycle shutdown handler has a higher priority than the power off handlers. So, if you have IPMI enabled, the power cylce will take precedence and that will happen. If not (or the IPMI fails to power off within the timeout period), then the power off will happen. Warner On Tue, Nov 14, 2017 at 11:50 AM, Ronald Klop wrote: > 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" >> >