Solved poweroff reboots computer (usually)

Linux and Windows both power off my desktop consistently, but FreeBSD 10.2-RELEASE does so only once in a dozen tries or so. The rest of the time it reboots. I've had this problem since the install was fresh. I've used poweroff and shutdown -p now. I assume this is some ACPI bug in my BIOS, but there must be some way Linux and Windows are working around it.

Is there anything I can try?
 
If you have a "Wake On LAN" feature in your BIOS/UEFI, you could try turning that off if it's on to see if that helps.
 
If you have a "Wake On LAN" feature in your BIOS/UEFI, you could try turning that off if it's on to see if that helps.
The closest thing I can find is a "PCI Devices Power On" setting. Disabling that didn't help. Neither did changing any other ACPI settings.
 
Update the BIOS. What brand and model of system is this?
The motherboard is an ASRock G31M-GS R2.0 with the latest 1.90 BIOS firmware. The system is built from parts. Nothing exotic, just a Core 2 Quad, two SATA hard drives and an SSD, an IDE DVD burner and a GeForce GTX 275.
 
Today I discovered acpiconf -s 3 has trouble, too. Suspend appears to work, but my computer emits three beeps (with long intervals between them) on resume and my monitor remains dark. Yet the OS is running. Holding down backspace produces terminal beeps and I could restart with poweroff at the console.
 
FWIW, I've never gotten resume to work on any machines with NVidia graphics cards of any model using the sc(4) or vt(4) console driver. I always get the same outcome as above on every machine I've tried it on. It may be worth asking this on one of the FreeBSD mailing lists. I know there has been some work on power management being done but am not sure if this would fit in with that work.
 
FWIW, I have FreeBSD 10.2-RELEASE (no X) on an HP-XW4400 with an Asus ATI video card (I forget which one) and reboot and poweroff, work exactly as advertised.
 
Linux and Windows both power off my desktop consistently, but FreeBSD 10.2-RELEASE does so only once in a dozen tries or so. The rest of the time it reboots. I've had this problem since the install was fresh. I've used poweroff and shutdown -p now. I assume this is some ACPI bug in my BIOS, but there must be some way Linux and Windows are working around it.

Is there anything I can try?

You are not doing anything wrong (probably (in this case)). Hardware powerdown seems to be a perennial problem that doesn't really have a solid solution yet (on FreeBSD (as far as I can tell (are these nested parenthesis annoying? (Lisp warped my mind)))).

Section "12.5. Shutdown Sequence" of the Handbook says "Note: Power management requires acpi(4) to be loaded as a module or statically compiled into a custom kernel".

grep -i acpi /usr/src/sys/i386/conf/GENERIC
Code:
device  acpi
acpi(4) seems to be compiled into the GENERIC kernel so loading and unloading modules isn't needed. Okay, moving on.

Section "11.13.2.5. System Powers Up After Suspend or Shutdown" of the Handbook says:
First, try setting [FONT=Times New Roman]hw.acpi.disable_on_poweroff="0"[/FONT] in /boot/loader. This keeps ACPI from disabling various events during the shutdown process. Some systems need this value set to 1 (the default) for the same reason. This usually fixes the problem of a system powering up spontaneously after a suspend or poweroff.

But on my system that knob doesn't seem to exist:
sysctl -a | grep hw.acpi.disable
Code:
hw.acpi.disable_on_reboot: 0
(an issue report needs to be sent to the Handbook maintainers?)

acpi(4) describes the [FONT=Times New Roman]hw.acpi.disable_on_reboot[/FONT] variable as:
hw.acpi.disable_on_reboot
Disable ACPI during the reboot process. Most systems reboot fine
with ACPI still enabled, but some require exiting to legacy mode
first. Default is 0, leave ACPI enabled.​

Maybe you could try:
sudo sysctl hw.acpi.disable_on_reboot=1
sudo halt -p
And see what happens...

Now, to rub a little salt into this wound, OpenBSD solved this problem 15 years ago:
proposed sysctl for i386 halt -p problem
 
Last edited by a moderator:
You are not doing anything wrong (probably (in this case)). Hardware powerdown seems to be a perennial problem that doesn't really have a solid solution yet (on FreeBSD (as far as I can tell

It is an unusual problem on FreeBSD. This is the first time I've heard of a problem with it in, well, I don't recall. More than a few years, certainly.

Disabling ACPI turns out to not be very viable. It is needed for a lot of things on modern machines.

The OpenBSD code is... well, it's patches for APM, which is long obsolete. Maybe they still use it on OpenBSD, but it seems unlikely.
 
It is an unusual problem on FreeBSD. This is the first time I've heard of a problem with it in, well, I don't recall. More than a few years, certainly.
Research into the issue might begin with a Google search for "FreeBSD does not power off".

Disabling ACPI turns out to not be very viable. It is needed for a lot of things on modern machines.
hw.acpi.disable_on_reboot=1 seems to only disable ACPI during the reboot process (according to acpi(4)). I'm eager to here from pswinslow, whether or not it solves the problem.

The OpenBSD code is... well, it's patches for APM, which is long obsolete. Maybe they still use it on OpenBSD, but it seems unlikely.
Here's the current OpenBSD man page for apm(4), and the OpenBSD sysctl(8) variable is [FONT=Courier New]machdep.apmhalt[/FONT]
 
Last edited by a moderator:
I had it on Lenovo Y570. It's a bug somewhere in harware/firmware. There's no BIOS update for me, therefore I have to live with it.
 
I just use # shutdown - h now. Well, my rig has an Asus card (Radeon RX 550 4GB). That works fine, as in the OS shuts down no problem, does not reboot. Sometimes, the power is not cut completely, though, so I have to finish the job by holding the hardware power button on the box until the blue backlight turns off. I don't think that's too much inconvenience, because the rig is under my desk. But still, some useful info in here! :)
 
Sometimes, the power is not cut completely, though
shutdown -h now only halts the system. Use shutdown -p now to actually have it power off too.

Code:
     -h      The system is halted at the specified time.

     -p      The system is halted and the power is turned off (hardware
             support required, otherwise the system is halted) at the
             specified time.
Code:
     Calling “poweroff” is equivalent to running:

           shutdown -p now
See shutdown(8).
 
Back
Top