From owner-freebsd-bugs@FreeBSD.ORG Sun Aug 15 10:50:13 2004 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A60C316A4CE for ; Sun, 15 Aug 2004 10:50:13 +0000 (GMT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7D2A943D49 for ; Sun, 15 Aug 2004 10:50:13 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.11/8.12.11) with ESMTP id i7FAoDvC062670 for ; Sun, 15 Aug 2004 10:50:13 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.11/8.12.11/Submit) id i7FAoDI6062669; Sun, 15 Aug 2004 10:50:13 GMT (envelope-from gnats) Resent-Date: Sun, 15 Aug 2004 10:50:13 GMT Resent-Message-Id: <200408151050.i7FAoDI6062669@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Dmitri Nikulin Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0590516A4CE for ; Sun, 15 Aug 2004 10:48:14 +0000 (GMT) Received: from www.freebsd.org (www.freebsd.org [216.136.204.117]) by mx1.FreeBSD.org (Postfix) with ESMTP id EEA5A43D2F for ; Sun, 15 Aug 2004 10:48:13 +0000 (GMT) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.12.11/8.12.11) with ESMTP id i7FAmDxu083060 for ; Sun, 15 Aug 2004 10:48:13 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.12.11/8.12.11/Submit) id i7FAmD4g083059; Sun, 15 Aug 2004 10:48:13 GMT (envelope-from nobody) Message-Id: <200408151048.i7FAmD4g083059@www.freebsd.org> Date: Sun, 15 Aug 2004 10:48:13 GMT From: Dmitri Nikulin To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-2.3 Subject: misc/70476: sbin/reboot change, -p behavior default for halt X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Aug 2004 10:50:13 -0000 >Number: 70476 >Category: misc >Synopsis: sbin/reboot change, -p behavior default for halt >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: update >Submitter-Id: current-users >Arrival-Date: Sun Aug 15 10:50:13 GMT 2004 >Closed-Date: >Last-Modified: >Originator: Dmitri Nikulin >Release: 5.2-CURRENT >Organization: >Environment: >Description: Power-off functionality is usually expected from systems which support ACPI even half as well as FreeBSD does, yet the default behavior of halt is a completely soft shutdown. Environments that use halt (e.g. display managers) need messy reconfiguration, and users that aren't aware of the -p flag might never learn about it. Using acpiconf properly achieves the same result but with even more divergence from what people expect to have to type. Applied from src/sbin, this patch makes -p functionality the default for halt (much like on typical GNU/Linux systems). >How-To-Repeat: halt without -p >Fix: diff -ruN reboot/reboot.8 reboot.new/reboot.8 --- reboot/reboot.8 2004-07-31 22:11:35.000000000 +1000 +++ reboot.new/reboot.8 2004-08-15 22:47:20.349003304 +1000 @@ -112,6 +112,7 @@ or .Nm was called. +(If called as halt, this is the default) .El .Pp The diff -ruN reboot/reboot.c reboot.new/reboot.c --- reboot/reboot.c 2004-07-31 22:11:35.000000000 +1000 +++ reboot.new/reboot.c 2004-08-15 22:41:12.656901000 +1000 @@ -72,10 +72,10 @@ if (strstr((p = rindex(*argv, '/')) ? p + 1 : *argv, "halt")) { dohalt = 1; - howto = RB_HALT; + howto = RB_HALT|RB_POWEROFF; } else howto = 0; - kflag = lflag = nflag = qflag = 0; + kflag = lflag = nflag = qflag = pflag = 0; while ((ch = getopt(argc, argv, "dk:lnpq")) != -1) switch(ch) { case 'd': (Unbroken copy at http://members.optusnet.com.au/setagllib/reboot.patch) >Release-Note: >Audit-Trail: >Unformatted: