Date: Sun, 24 Aug 2008 17:22:34 +0200 From: Harry Matthiesen Jensen <freebsd@elgert.dk> To: freebsd-questions@freebsd.org Subject: Catch kernel notification in devd.conf Message-ID: <20080824152234.GA913@mugin.localhost>
next in thread | raw e-mail | index | archive | help
Hi,
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 hw.acpi.battery.life" ;-), 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20080824152234.GA913>
