Ivailo Bonev wrote:
I have a new HP 6720s laptop. When discharge battery, FreeBSD don't shutdown automatically on low battery.
How can set that?

I've an 6710b and experienced similar "shutdowns" :)

Try this:

/etc/rc.conf:

  devd_enable="YES"

/etc/devd.conf:

  notify 10 {
        match "system"         "ACPI";
        match "subsystem"      "CMBAT";
        match "notify"         "0x80";
        action "/etc/acpi_battery 30 5";
  };

/etc/acpi_battery:

  #!/bin/sh

  warn_level=$1
  shutdown_level=$2

  life=`sysctl -n hw.acpi.battery.life`

  if [ "$life" -lt $shutdown_level ]; then
    echo "shutdown"
    /sbin/shutdown -h now
  elif [ "$life" -lt $warn_level ]; then
    echo "warn"
  fi

There might be an easier way, if there is a different notify command for battery low. I guess 0x80 is just battery info.

Regards,

  Michael
_______________________________________________
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"

Reply via email to