From keramida@bytemobile.com  Mon Aug 16 12:38:47 2004
Return-Path: <keramida@bytemobile.com>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 2A18E16A4CE
	for <FreeBSD-gnats-submit@freebsd.org>; 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 <FreeBSD-gnats-submit@freebsd.org>; 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])
	by kane.otenet.gr (8.12.11/8.12.11/Debian-3) with SMTP id i7GCcgu0012511
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 16 Aug 2004 15:38:43 +0300
Received: from orion.daedalusnetworks.priv (orion [127.0.0.1])
	by orion.daedalusnetworks.priv (8.13.1/8.13.1) with ESMTP id i7GCccAa004129
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 16 Aug 2004 15:38:38 +0300 (EEST)
	(envelope-from keramida@orion.daedalusnetworks.priv)
Received: (from keramida@localhost)
	by orion.daedalusnetworks.priv (8.13.1/8.13.1/Submit) id 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 <keramida@ceid.upatras.gr>
Reply-To: Giorgos Keramidas <keramida@ceid.upatras.gr>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: reboot -dp tries to dump when powering off
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         70536
>Category:       bin
>Synopsis:       reboot(8) -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:  Sat May 24 20:43:41 UTC 2008
>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:
Responsible-Changed-From-To: freebsd-bugs->edwin 
Responsible-Changed-By: edwin 
Responsible-Changed-When: Tue Jan 29 12:55:49 UTC 2008 
Responsible-Changed-Why:  
I'll handle with mentor. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=70536 
Responsible-Changed-From-To: edwin->freebsd-bugs 
Responsible-Changed-By: edwin 
Responsible-Changed-When: Thu Feb 14 10:34:20 UTC 2008 
Responsible-Changed-Why:  

Give back into the pool until later. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=70536 
>Unformatted:
