Solved poweroff reboots computer (usually)

pswinslow

New Member


Messages: 14

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?
 

protocelt

Daemon

Reaction score: 414
Messages: 1,253

Is this a laptop or a desktop system?

Edit: Nevermind, I guess I can't read today :(
 

protocelt

Daemon

Reaction score: 414
Messages: 1,253

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.
 

wblock@

Beastie Himself
Developer

Reaction score: 3,779
Messages: 13,851

Update the BIOS. What brand and model of system is this?
 
OP
pswinslow

pswinslow

New Member


Messages: 14

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.
 
OP
pswinslow

pswinslow

New Member


Messages: 14

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.
 
OP
pswinslow

pswinslow

New Member


Messages: 14

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.
 

protocelt

Daemon

Reaction score: 414
Messages: 1,253

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.
 

Itproman

Member

Reaction score: 1
Messages: 75

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.
 

hanzer

Member

Reaction score: 10
Messages: 97

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:

wblock@

Beastie Himself
Developer

Reaction score: 3,779
Messages: 13,851

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.
 

hanzer

Member

Reaction score: 10
Messages: 97

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:

plis

New Member

Reaction score: 2
Messages: 2

I encounter the same problem. On my desktop I have Windows 7 and FreeBSD. Windows 7 can shutdown consistently. FreeBSD 12 can too, but after I upgraded to FreeBSD 13.0 yesterday, it always powers up after 'poweroff' or 'shutdown -p now'. The solution in the handbook 12.13.2.5. System Powers Up After Suspend or Shutdown doesn't help either.

Anyone has solutions? Thanks in advance. ;-)
 

George

Aspiring Daemon

Reaction score: 221
Messages: 530

Try this sysctl:
Code:
hw.efi.poweroff: If true, use EFI runtime services to power off in preference to ACPI

Maybe we should add this to the handbook.
 

a6h

Daemon

Reaction score: 1,611
Messages: 1,430

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.
 

plis

New Member

Reaction score: 2
Messages: 2

astyle

Daemon

Reaction score: 1,019
Messages: 2,011

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! :)
 

SirDice

Administrator
Staff member
Administrator
Moderator

Reaction score: 14,070
Messages: 40,785

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).
 
Top