Date: Tue, 1 Jun 2010 10:55:08 +0200 From: David DEMELIER <demelier.david@gmail.com> To: freebsd-questions@freebsd.org Subject: Automatic shutdown with devd. Message-ID: <AANLkTil3-OAHf8nnJTjU-q01-V7LZY8UM0La3DcM1Afv@mail.gmail.com>
next in thread | raw e-mail | index | archive | help
Hi,
I recently asked to make an automatic shutdown when I excess a
specific percent. I ran devd with -Dd flags to run in background and
when the battery was at a critical state it said :
Processing event '!system=ACPI subsystem=CMBAT type=\_SB_.BAT0 notify=0x80'
Pushing table
setting system=ACPI
setting subsystem=CMBAT
setting type=\_SB_.BAT0
setting notify=0x80
Then I tried (for testing) something like this in my /etc/devd.conf
notify 10 {
        match "system"          "ACPI";
        match "subsystem"       "CMBAT";
        match "notify"          "0x80";
        action "logger LETGOSHUTDOWN";
};
And then I can see the following output in /var/log/messages :
Jun  1 10:48:54 Melon power_profile: changed to 'performance'
Jun  1 10:48:56 Melon root: LETGOSHUTDOWN
Jun  1 10:49:12 Melon root: LETGOSHUTDOWN
Jun  1 10:51:06 Melon last message repeated 2 times
It works, but the problem is that it makes this even the cable is
plugged ! i.e : the computer was not powered on so with 3% of
remaining time but AC plugged in after booting it (always with the AC
plugged in) these messages appears too. I guess the ACPI/CMBAT do not
care if there is an AC plugged in or not.
Is there a way to make this conditional to do only if the laptop is
not charging, AC plugged in ?
With king regards.
-- 
Demelier David
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?AANLkTil3-OAHf8nnJTjU-q01-V7LZY8UM0La3DcM1Afv>
