From owner-freebsd-questions@FreeBSD.ORG Wed Apr 2 11:45:49 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 06131106566B for ; Wed, 2 Apr 2008 11:45:49 +0000 (UTC) (envelope-from mneumann@ntecs.de) Received: from core.ntecs.de (213-239-223-123.clients.your-server.de [213.239.223.123]) by mx1.freebsd.org (Postfix) with ESMTP id B5DB28FC2D for ; Wed, 2 Apr 2008 11:45:48 +0000 (UTC) (envelope-from mneumann@ntecs.de) Received: from localhost (unknown [127.0.0.1]) by core.ntecs.de (Postfix) with ESMTP id 4D1273316E; Wed, 2 Apr 2008 13:12:53 +0200 (CEST) Received: from core.ntecs.de ([127.0.0.1]) by localhost (core.ntecs.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 91170-01; Wed, 2 Apr 2008 13:12:49 +0200 (CEST) Received: from nunus.localnet (krlh-4dbdfc27.pool.einsundeins.de [77.189.252.39]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by core.ntecs.de (Postfix) with ESMTP id 9B3283311F; Wed, 2 Apr 2008 13:12:49 +0200 (CEST) Message-ID: <47F36D16.6040300@ntecs.de> Date: Wed, 02 Apr 2008 13:25:10 +0200 From: Michael Neumann User-Agent: Thunderbird 2.0.0.9 (X11/20080213) MIME-Version: 1.0 Newsgroups: gmane.os.freebsd.questions To: Ivailo Bonev References: <003901c89496$189b5f20$f800000a@chameleon> In-Reply-To: <003901c89496$189b5f20$f800000a@chameleon> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: amavisd-new at ntecs.de 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:45:49 -0000 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