Current-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

powerd, estd, and envsys (Re: envsys powerd script invocation order)



At Tue, 22 Jun 2010 12:06:04 -0400,
Marko SchÃtz Schmuck wrote:
> 
> I noticed that the sensor_temperature script frequently is called out
> of order: the call for the "normal" event comes before the call for
> the "critical-over" event.

after experimenting some more with the events delivered by powerd, it
seems that some events are lost. I had counters that counted +1 for
every critical-over and -1 for every normal event and never saw
any positive values in the counters only increasingly negative
values. 

I now call the following script for normal as well as critical-over
events (onestop alone sometimes left the process around, so I added
the pkill...):

#!/bin/sh

STAT0=`envstat -d coretemp0 | tail -1`
CORETEMP0=`echo $STAT0 |sed -e "s|cpu[[:digit:]] 
temperature:[[:space:]]*\([[:digit:]]*\)\..*|\1|"`
CRITTEMP0=`echo $STAT0 |sed -e "s|cpu[[:digit:]] 
temperature:[[:space:]]*[[:digit:]]*\.[[:digit:]]*[[:space:]]*\([[:digit:]]*\)\..*|\1|"`

STAT1=`envstat -d coretemp1 | tail -1`
CORETEMP1=`echo $STAT1 |sed -e "s|cpu[[:digit:]] 
temperature:[[:space:]]*\([[:digit:]]*\)\..*|\1|"`
CRITTEMP1=`echo $STAT1 |sed -e "s|cpu[[:digit:]] 
temperature:[[:space:]]*[[:digit:]]*\.[[:digit:]]*[[:space:]]*\([[:digit:]]*\)\..*|\1|"`

if [ $CORETEMP0 -lt $CRITTEMP0 -a $CORETEMP1 -lt $CRITTEMP1 ] ; then
    echo "estd_flags=\"-l 35 -h 50 -b -M 1200\"" >/etc/rc.conf.d/estd
    /etc/rc.d/estd onestop
    pkill -f sbin/estd
    rm -f /var/run/estd.pid
    /etc/rc.d/estd onestart
elif [ $CORETEMP0 -ge $DRITTEMP0 -o $CORETEMP1 -ge $CRITTEMP1] ; then
    echo "estd_flags=\"-l 99 -h 100 -b -M 600\"" >/etc/rc.conf.d/estd
    /etc/rc.d/estd onestop
    pkill -f sbin/estd
    rm -f /var/run/estd.pid
    /etc/rc.d/estd onestart
fi


Best regards,

Marko

Attachment: pgpcD76iNzea5.pgp
Description: PGP signature



Home | Main Index | Thread Index | Old Index