From owner-svn-src-head@freebsd.org Fri Jan 17 01:20:48 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DF7171FC450; Fri, 17 Jan 2020 01:20:48 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47zNYD5Pblz3Nvf; Fri, 17 Jan 2020 01:20:48 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B4C3EB09; Fri, 17 Jan 2020 01:20:48 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00H1KmIg083494; Fri, 17 Jan 2020 01:20:48 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00H1Kmeh083492; Fri, 17 Jan 2020 01:20:48 GMT (envelope-from imp@FreeBSD.org) Message-Id: <202001170120.00H1Kmeh083492@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 17 Jan 2020 01:20:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356821 - in head/sbin: init shutdown X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/sbin: init shutdown X-SVN-Commit-Revision: 356821 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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: Fri, 17 Jan 2020 01:20:48 -0000 Author: imp Date: Fri Jan 17 01:20:48 2020 New Revision: 356821 URL: https://svnweb.freebsd.org/changeset/base/356821 Log: Small tweak to the default behavior of shutdown -c 'shutdown -c' is supposed to power cycle the system rather than doing a normal reboot. However, when that fails, it halts the system. This is not quite right since the intent isn't to halt the system but to restart. Make the default init behavior be to restart the system. The halt(8) interface can be used if you'd like to powercycle or halt. MFC After: 1 week Differential Revision: https://reviews.freebsd.org/D23129 Modified: head/sbin/init/init.c head/sbin/shutdown/shutdown.8 Modified: head/sbin/init/init.c ============================================================================== --- head/sbin/init/init.c Fri Jan 17 01:16:23 2020 (r356820) +++ head/sbin/init/init.c Fri Jan 17 01:20:48 2020 (r356821) @@ -1629,12 +1629,14 @@ transition_handler(int sig) current_state == clean_ttys || current_state == catatonia) requested_transition = clean_ttys; break; - case SIGWINCH: case SIGUSR2: - howto = sig == SIGUSR2 ? RB_POWEROFF : RB_POWERCYCLE; + howto = RB_POWEROFF; case SIGUSR1: howto |= RB_HALT; + case SIGWINCH: case SIGINT: + if (sig == SIGWINCH) + howto |= RB_POWERCYCLE; Reboot = TRUE; case SIGTERM: if (current_state == read_ttys || current_state == multi_user || Modified: head/sbin/shutdown/shutdown.8 ============================================================================== --- head/sbin/shutdown/shutdown.8 Fri Jan 17 01:16:23 2020 (r356820) +++ head/sbin/shutdown/shutdown.8 Fri Jan 17 01:20:48 2020 (r356821) @@ -28,7 +28,7 @@ .\" @(#)shutdown.8 8.2 (Berkeley) 4/27/95 .\" $FreeBSD$ .\" -.Dd January 1, 2018 +.Dd January 11, 2020 .Dt SHUTDOWN 8 .Os .Sh NAME @@ -63,7 +63,7 @@ The following options are available: The system is power cycled (power turned off and then back on) at the specified time. If the hardware doesn't support power cycle, the system will be -halted. +rebooted. At the present time, only systems with BMC supported by the .Xr ipmi 4 driver that implement this functionality support this flag.