From owner-freebsd-questions@FreeBSD.ORG Thu Jun 3 04:42:39 2010 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 23A3B1065678 for ; Thu, 3 Jun 2010 04:42:39 +0000 (UTC) (envelope-from smithi@nimnet.asn.au) Received: from sola.nimnet.asn.au (paqi.nimnet.asn.au [115.70.110.159]) by mx1.freebsd.org (Postfix) with ESMTP id 6A5378FC18 for ; Thu, 3 Jun 2010 04:42:38 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by sola.nimnet.asn.au (8.14.2/8.14.2) with ESMTP id o534gN4e032173; Thu, 3 Jun 2010 14:42:23 +1000 (EST) (envelope-from smithi@nimnet.asn.au) Date: Thu, 3 Jun 2010 14:42:22 +1000 (EST) From: Ian Smith To: David DEMELIER In-Reply-To: Message-ID: <20100603141648.E27982@sola.nimnet.asn.au> References: <20100601120131.A070C10657ED@hub.freebsd.org> <20100602001405.T27982@sola.nimnet.asn.au> MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="0-866469246-1275539744=:27982" Content-ID: <20100603143557.F27982@sola.nimnet.asn.au> Cc: freebsd-questions@freebsd.org Subject: Re: Automatic shutdown with devd. 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: Thu, 03 Jun 2010 04:42:39 -0000 This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --0-866469246-1275539744=:27982 Content-Type: TEXT/PLAIN; CHARSET=ISO-8859-1 Content-Transfer-Encoding: 8BIT Content-ID: <20100603143557.C27982@sola.nimnet.asn.au> On Tue, 1 Jun 2010, David DEMELIER wrote: > 2010/6/1 Ian Smith : > > In freebsd-questions Digest, Vol 313, Issue 4, Message: 26 > > On Tue, 1 Jun 2010 10:55:08 +0200 David DEMELIER wrote: [..] > >  > Is there a way to make this conditional to do only if the laptop is > >  > not charging, AC plugged in ? > > > > Your script can check whether the AC power is on with: > > > >        AC=`sysctl -n hw.acpi.acline` > >        if [ $AC = 1 ]; then > >                exit 0          # or whatever, when on AC power > >        elif [ $AC = 0 ]; then > >                :               # do whatever when on battery > >        else > >                :               # AC/Battery state unknown .. > >        fi > > > > You could try just logging all state changes for a while; from critical > > charging to charging to high to discharging to critical discharging, I > > think that's the lot .. you can also check hw.acpi.battery.life etc. > > > > Okay I will try a script like this one. Let us know how it goes; it's clearer now from below why you need this. > > However, your system should do an 'emergency suspend' on critical low > > battery anyway .. usually set at 1% capacity but some BIOS will let you > > adjust that (see acpiconf -i0).  Only if suspend/resume works of course. > > > > It would be great if suspend/resume would works yes ! For the moment > it's not the case : > > http://www.freebsd.org/cgi/query-pr.cgi?pr=i386/146715 Ah yes. I guess you might have to try the freebsd-acpi list about that, after reading the ACPI debugging section of the Handbook, providing your dmesg and probably an acpidump of your ASL as shown there. I don't know the current status of suspend/resume on amd64, nor anything about your HP Probook 4510s. The freebsd-mobile list might be a better place to start, at least to ask whether anyone else shares your problem? cheers, Ian --0-866469246-1275539744=:27982--