On Sat, Mar 06, 2010 at 02:26:28PM +0100, Tomas Bodzar wrote: > Hi all, > > I set sensorsd and sensorsd.conf this way : > > # $OpenBSD: sensorsd.conf,v 1.8 2007/08/14 19:02:02 cnst Exp $
> # Monitor laptop battery for remaining capacity > hw.sensors.acpibat0.watthour3:low=1.40Wh:command=/etc/sensorsd/switchoff > Command is simple : > > #!/bin/sh > shutdown -h now "Shutdown caused by sensor" > > It's running from point of view that computer is turned off in case of > low battery or high battery on some of sensor which has command > assigned. Problem starts if your battery is empy and computer turned > off. So you plug AC and start laptop. If you are below limit for > hw.sensors.acpibat0.watthour3 then your laptop is turned off after > login again. It's quite understandable, but if you're above limit > behavior is still same. Is it problem this part from man page for > sensorsd.conf? > > If the limits are crossed or if the status provided by the driver > changes, sensorsd(8)'s alert functionality is triggered and a command, if > specified, is executed. > > Battery status trough this sensor is changing because battery was > empty and now laptop is in AC and charging. Does it really mean that > it will turn off my computer after every change of battery status > untill my battery is fully recharged? Yes. Write a better script to fix this. Some ideas: if the CPU gets hot, switch to low speed (apm -L) instead of turning the machine off; if the battery is low, check if you're connected to wall power before turning off; etc. Joachim