From owner-freebsd-bugs@FreeBSD.ORG Mon Aug 16 12:40:11 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 7898516A4CE for ; Mon, 16 Aug 2004 12:40:11 +0000 (GMT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5B98043D49 for ; Mon, 16 Aug 2004 12:40:11 +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 i7GCeBbl037790 for ; Mon, 16 Aug 2004 12:40:11 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.11/8.12.11/Submit) id i7GCeB58037785; Mon, 16 Aug 2004 12:40:11 GMT (envelope-from gnats) Resent-Date: Mon, 16 Aug 2004 12:40:11 GMT Resent-Message-Id: <200408161240.i7GCeB58037785@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, Giorgos Keramidas Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2A18E16A4CE for ; Mon, 16 Aug 2004 12:38:47 +0000 (GMT) Received: from kane.otenet.gr (kane.otenet.gr [195.170.0.27]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3D82743D39 for ; Mon, 16 Aug 2004 12:38:46 +0000 (GMT) (envelope-from keramida@bytemobile.com) Received: from orion.daedalusnetworks.priv (aris.bedc.ondsl.gr [62.103.39.226])i7GCcgu0012511 for ; Mon, 16 Aug 2004 15:38:43 +0300 Received: from orion.daedalusnetworks.priv (orion [127.0.0.1]) i7GCccAa004129 for ; Mon, 16 Aug 2004 15:38:38 +0300 (EEST) (envelope-from keramida@orion.daedalusnetworks.priv) Received: (from keramida@localhost)i7GCccmQ004128; Mon, 16 Aug 2004 15:38:38 +0300 (EEST) (envelope-from keramida) Message-Id: <200408161238.i7GCccmQ004128@orion.daedalusnetworks.priv> Date: Mon, 16 Aug 2004 15:38:38 +0300 (EEST) From: Giorgos Keramidas To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Subject: bin/70536: reboot -dp tries to dump when powering off X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Giorgos Keramidas List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Aug 2004 12:40:11 -0000 >Number: 70536 >Category: bin >Synopsis: reboot -dp tries to dump when powering off >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Mon Aug 16 12:40:10 GMT 2004 >Closed-Date: >Last-Modified: >Originator: Giorgos Keramidas >Release: FreeBSD 5.2-CURRENT i386 >Organization: >Environment: System: FreeBSD orion.daedalusnetworks.priv 5.2-CURRENT \ FreeBSD 5.2-CURRENT #1: Wed Aug 11 20:24:38 EEST 2004 \ root@orion.daedalusnetworks.priv:/usr/obj/usr/src/sys/ORION i386 >Description: The reboot command when called as "halt" does not allow kernel dumps. The message printed is: halt: cannot dump (-d) when halting; must reboot instead The same command allows the user to specify both -d and -p options though, which attempt to generate a kernel dump and then promptly power off the machine using ACPI. I've marked this as a change-request since it's not a real *bug*; it's more something that seems "natural" to me and I have in my local src tree for a while now. >How-To-Repeat: # halt -d # reboot -dp >Fix: The following minor patch makes RB_HALT and RB_POWEROFF equivalent regarding kernel dumps. %%% Index: reboot.c =================================================================== RCS file: /home/ncvs/src/sbin/reboot/reboot.c,v retrieving revision 1.20 diff -u -r1.20 reboot.c --- reboot.c 9 Apr 2004 19:58:35 -0000 1.20 +++ reboot.c 16 Aug 2004 12:25:16 -0000 @@ -108,6 +108,8 @@ if ((howto & (RB_DUMP | RB_HALT)) == (RB_DUMP | RB_HALT)) errx(1, "cannot dump (-d) when halting; must reboot instead"); + if ((howto & (RB_DUMP | RB_POWEROFF)) == (RB_DUMP | RB_POWEROFF)) + errx(1, "cannot dump (-d) when powering off; must reboot instead"); if (geteuid()) { errno = EPERM; err(1, NULL); %%% >Release-Note: >Audit-Trail: >Unformatted: