From owner-freebsd-bugbusters@FreeBSD.ORG Sun Aug 15 02:59:08 2004 Return-Path: Delivered-To: freebsd-bugbusters@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3565A16A4CE for ; Sun, 15 Aug 2004 02:59:08 +0000 (GMT) Received: from mail06.syd.optusnet.com.au (mail06.syd.optusnet.com.au [211.29.132.187]) by mx1.FreeBSD.org (Postfix) with ESMTP id 78C2143D2D for ; Sun, 15 Aug 2004 02:59:07 +0000 (GMT) (envelope-from setagllib@optusnet.com.au) Received: from [192.168.1.3] (c211-28-250-208.eburwd5.vic.optusnet.com.au [211.28.250.208]) (authenticated bits=0)i7F2x4gM005213 for ; Sun, 15 Aug 2004 12:59:05 +1000 Message-ID: <411ED170.1060008@optusnet.com.au> Date: Sun, 15 Aug 2004 12:58:56 +1000 From: Dmitri Nikulin User-Agent: Mozilla Thunderbird 0.7.3 (X11/20040814) X-Accept-Language: en-us, en MIME-Version: 1.0 To: bugbusters@FreeBSD.org X-Enigmail-Version: 0.85.0.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: sbin/reboot change, -p behavior default for halt X-BeenThere: freebsd-bugbusters@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Coordination of the Problem Report handling effort. List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Aug 2004 02:59:08 -0000 Category: misc Severity: non-critical Priority: low Class: update Release: 5.2-CURRENT Full 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': (Thunderbird breaks tabbing; actual patch available on http://members.optusnet.com.au/setagllib/reboot.patch)