Shutdown results in reboot

jbodenmann

Aspiring Daemon

Reaction score: 307
Messages: 552

I just got my hands on a fresh Lenovo ThinkPad X1 Carbon Gen 9. I installed FreeBSD 13.0-RELEASE on it. When I execute poweroff, the system does shut down but it immediately boots again afterwards.

TPM and most other stuff is disabled.

Any ideas?
 
OP
jbodenmann

jbodenmann

Aspiring Daemon

Reaction score: 307
Messages: 552

Have a look at the sysctl(8) hw.efi.poweroff uid.
Setting that to false did the trick.
While looking at this option I came across this relevant thread (for reference): https://forums.freebsd.org/threads/mainboard-restarts-by-itself-after-freebsd-shutdown.79614/
Given that this is enabled by default; what are the downsides/disadvantages of going through good old ACPI instead of using EFI for poweroff?

Does it do the same with 14.0-CURRENT?
I don't know :)
 

GogoFC

New Member


Messages: 6

Same thing on my Elitebook 840.

init 0 doesn't restart unless I close the lid, then it boots again , i have to wait a bit and then close it.

Isn't power off just init 0?
 

SirDice

Administrator
Staff member
Administrator
Moderator

Reaction score: 13,071
Messages: 39,685

Isn't power off just init 0?
No, init 0 halts the system. shutdown -p now powers down the system:
Code:
     -p      The system is halted and the power is turned off (hardware
             support required, otherwise the system is halted) at the
             specified time.
 

SirDice

Administrator
Staff member
Administrator
Moderator

Reaction score: 13,071
Messages: 39,685

Code:
     Calling “poweroff” is equivalent to running:

           shutdown -p now
poweroff(8)

Yes, that resulted in the same behavior (booting again after shutdown) unless `hw.efi.poweroff` is set to `0`.
Need to try this on a one test machine I have. It has the uncanny habit of turning itself back on after a shutdown -p now too.
 
OP
jbodenmann

jbodenmann

Aspiring Daemon

Reaction score: 307
Messages: 552

@jbodenmann "shutdown -p now" works on my X1 carbon Gen 9 machine.
Well, not to be nit-picky but it also works on my machine - it just boots again after successfully shutting down :p

I do however assume that in your case the machine does not boot up again?
What's the value of hw.efi.poweroff on your machine?
 

Tieks

Well-Known Member

Reaction score: 134
Messages: 311

it just boots again after successfully shutting down
Mine shows that same behaviour depending on a BIOS setting. It's a setting named 'AC back' under the power managemant options. It determines what happens when power comes back after a power loss. It has three options. The first is 'memory, the system returns to its last known awake state' (according to the booklet). This option gives the behaviour that you describe. The other options are 'always on' (switches on when power returns) and 'always off' (stay off when power returns). The latter is the default. You may have some similar options in your BIOS.
 

grahamperrin

Son of Beastie

Reaction score: 1,006
Messages: 3,418

… when power comes back after a power loss. … 'memory, the system returns to its last known awake state' (according to the booklet). This option gives the behaviour that you describe. …

Is there loss of power in this case?
 

Tieks

Well-Known Member

Reaction score: 134
Messages: 311

Is there loss of power in this case?
No. Command shutdown -p now will indeed switch off, and then back on again after 1-2 seconds. It seems to do what the manual says, return to its last known awake state. The other options work as expected.
 
Top