Catch kernel notification in devd.conf

Harry Matthiesen Jensen freebsd at
Sun Aug 24 16:08:51 UTC 2008


I want my laptop to shutdown when the battery is critical low, but the
ACPI Battery info warning only comes on at a battery level of 10, but I
just noticed that the kernel logs:

kernel: battery0: critically low charge!

..this happens at battery "life" 7. Better point of shutting down, this
will give me at least 10 minutes more ;-)

How can I catch this in the devd.conf?

My current catch of the battery notifications looks like this (and it
works nicely, but in my point of view, too early):

notify 10 {
	match "system"          "ACPI";
	match "subsystem"       "CMBAT";
	action "/usr/local/etc/rc.d/battery";

Of course, I could make a loop in the "battery" shell script to catch it
from the "sysctl -n" ;-), but if I can get the
kernel "critically low charge", I think that's better.

Info: Laptop, Toshiba Satellite Pro L40
Mvh/Brgds Harry
FreeBSD 7.0-STABLE Compiled at Fri Aug 22 13:16:52 CEST 2008  i386

More information about the freebsd-questions mailing list