NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

kern/60451: sysmon: warn of low battery before forcing reboot



>Number:         60451
>Category:       kern
>Synopsis:       sysmon: warn of low battery before forcing reboot
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Jul 16 04:00:00 +0000 2026
>Originator:     Taylor R Campbell
>Release:        current, 11, 10, 9, ...
>Organization:
The WarningBatterieSD Foundation, Inc.
>Environment:
>Description:

	sysmon(4) will currently deliver a `low-power' event to
	powerd(8) if:

	- No AC adapters are plugged in.
	- All batteries are below the critical level.

	powerd(8) is mandated to commence an orderly shutdown -- the
	transition to sysmon_low_power state is irreversible:

	https://nxr.netbsd.org/xref/src/sys/dev/sysmon/sysmon_envsys_events.c?r=1.123#1017

	On past laptops, I would add a powerd(8) script for the
	warning-under event to suspend my laptop, to give me some time
	to plug in without losing my state.  But my current laptop has
	two batteries, and one might enter the warning state while the
	other has plenty of juice left.  Also, at boot, even if the
	laptop is plugged in, sysmon(4) may send warning-under events
	to powerd(8).

	It would be nice if sysmon(4) could deliver a `power-warning'
	event or something to powerd(8) if:

	- No AC adapters are plugged in.
	- All batteries are below the warning level.

>How-To-Repeat:

	1. find a bug that breaks xbattbar so you stop running it
	2. file a PR for that bug (TBD)
	3. run out of power working on something else

>Fix:

	Yes, please!




Home | Main Index | Thread Index | Old Index