bin/70536: reboot -dp tries to dump when powering off

Giorgos Keramidas keramida at
Mon Aug 16 05:40:11 PDT 2004

>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
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Mon Aug 16 12:40:10 GMT 2004
>Originator:     Giorgos Keramidas
>Release:        FreeBSD 5.2-CURRENT i386

System: FreeBSD orion.daedalusnetworks.priv 5.2-CURRENT \
FreeBSD 5.2-CURRENT #1: Wed Aug 11 20:24:38 EEST 2004 \
root at orion.daedalusnetworks.priv:/usr/obj/usr/src/sys/ORION i386


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.


        # halt -d
        # reboot -dp


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);


More information about the freebsd-bugs mailing list