From owner-freebsd-questions@FreeBSD.ORG Wed Apr 2 11:58:40 2008 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5432B1065673 for ; Wed, 2 Apr 2008 11:58:40 +0000 (UTC) (envelope-from ibb_orac@mbox.contact.bg) Received: from sd97.btc-net.bg (SD97.btc-net.bg [212.39.90.97]) by mx1.freebsd.org (Postfix) with SMTP id 8CDCC8FC38 for ; Wed, 2 Apr 2008 11:58:39 +0000 (UTC) (envelope-from ibb_orac@mbox.contact.bg) Received: (qmail 28951 invoked from network); 2 Apr 2008 11:58:38 -0000 Received: from unknown (HELO chameleon) (83.228.34.40) by 0 with SMTP; 2 Apr 2008 11:58:38 -0000 Message-ID: <004b01c894b8$e011b7d0$f800000a@chameleon> From: "Ivailo Bonev" To: "Michael Neumann" References: <003901c89496$189b5f20$f800000a@chameleon> <47F36D16.6040300@ntecs.de> Date: Wed, 2 Apr 2008 14:58:33 +0300 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="ISO-8859-1"; reply-type=response Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.3138 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3198 Cc: freebsd-questions@freebsd.org Subject: Re: HP 6720s automatic shutdown on low battery X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Apr 2008 11:58:40 -0000 ----- Original Message ----- From: "Michael Neumann" Newsgroups: gmane.os.freebsd.questions To: "Ivailo Bonev" Cc: Sent: Wednesday, April 02, 2008 2:25 PM Subject: Re: HP 6720s automatic shutdown on low battery > 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"; Is thiese numbers after "acpi_battery" are minutes? > }; > > /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 Thanks, I'll try script when battery is up, to see if works for me.