From owner-freebsd-questions@FreeBSD.ORG Sun Aug 24 16:08:51 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 C32F9106566C for ; Sun, 24 Aug 2008 16:08:51 +0000 (UTC) (envelope-from hmj@elgert.dk) Received: from pqueueb.post.tele.dk (pqueueb.post.tele.dk [193.162.153.10]) by mx1.freebsd.org (Postfix) with ESMTP id 727BE8FC0A for ; Sun, 24 Aug 2008 16:08:51 +0000 (UTC) (envelope-from hmj@elgert.dk) Received: from pfepb.post.tele.dk (pfepb.post.tele.dk [195.41.46.236]) by pqueueb.post.tele.dk (Postfix) with ESMTP id 852CC8A6C for ; Sun, 24 Aug 2008 17:51:11 +0200 (CEST) Received: from mugin (0x573c4f8e.nivaanqu1.dynamic.dsl.tele.dk [87.60.79.142]) by pfepb.post.tele.dk (Postfix) with ESMTP id 8E0F4F8405B for ; Sun, 24 Aug 2008 17:51:09 +0200 (CEST) Received: from mugin.localhost (localhost [127.0.0.1]) by mugin (8.14.2/8.14.2) with ESMTP id m7OFMYES001039 for ; Sun, 24 Aug 2008 17:22:34 +0200 (CEST) (envelope-from hmj@mugin.localhost) Received: (from hmj@localhost) by mugin.localhost (8.14.2/8.14.2/Submit) id m7OFMY4e001038 for freebsd-questions@freebsd.org; Sun, 24 Aug 2008 17:22:34 +0200 (CEST) (envelope-from hmj) Date: Sun, 24 Aug 2008 17:22:34 +0200 From: Harry Matthiesen Jensen To: freebsd-questions@freebsd.org Message-ID: <20080824152234.GA913@mugin.localhost> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.18 (2008-05-17) Subject: Catch kernel notification in devd.conf 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: Sun, 24 Aug 2008 16:08:51 -0000 Hi, I want my laptop to shutdown when the battery is critical low, but the ACPI Battery info warning only comes on at a battery level of 10, but I just noticed that the kernel logs: kernel: battery0: critically low charge! ..this happens at battery "life" 7. Better point of shutting down, this will give me at least 10 minutes more ;-) How can I catch this in the devd.conf? My current catch of the battery notifications looks like this (and it works nicely, but in my point of view, too early): notify 10 { match "system" "ACPI"; match "subsystem" "CMBAT"; action "/usr/local/etc/rc.d/battery"; }; Of course, I could make a loop in the "battery" shell script to catch it from the "sysctl -n hw.acpi.battery.life" ;-), but if I can get the kernel "critically low charge", I think that's better. Info: Laptop, Toshiba Satellite Pro L40 -- Mvh/Brgds Harry FreeBSD 7.0-STABLE Compiled at Fri Aug 22 13:16:52 CEST 2008 i386