Created attachment 224284 [details]
When I turn off my laptop with the AC/DC adapter plugged in, it reboots instead of shutting down. But if I unplug the adapter, my laptop shuts down.
% uname -a
FreeBSD vnflaptopmi.makmobile 13.0-RELEASE FreeBSD 13.0-RELEASE #0 releng/13.0-n244733-ea31abc261f: Fri Apr 9 04:24:09 UTC 2021 firstname.lastname@example.org:/usr/obj/usr/src/amd64.amd64/sys/GENERIC amd64
Laptop: Xiaomi Mi Notebook Pro 15.6 with Intel Core i7-8550U CPU.
A couple of similar problems in the forums ("reboot instead of shutting down") recently were resolved by setting this sysctl:
hw.efi.poweroff: If true, use EFI runtime services to power off in preference to ACPI
Maybe try that?
(In reply to georg.lastname from comment #1)
Many thanks! This solution did the trick.
However, I think this is strange. In 12.2 everything worked without problems. In 13.0 the problem appeared. But only if the laptop is connected to electricity. If you unplug the power cable and the powerd daemon manages to switch to economy mode, the laptop turns off normally.
This sysctl was introduced in FreeBSD 13.
On some laptops it solves the problem of reboots. On other laptops it causes reboots. Depending on how many ppl are affected, one might consider switching the default value of this boolean sysctl. :-)
(In reply to georg.lastname from comment #3)
Got it. Thanks for the link and clarification. Then I think the bug can be closed.