Chaintech VNF4 Ultra (NForce4 Ultra)
2 x 512 KingstoneVR PC3200
I want to use some software "emergency shutdown" and not to deppend only on BIOS to turn off system if it overheats.
So, as I use fancontrol and C'n'Q I made changes to /usr/sbin/fancontrol script.
(Beside that, I wasn't satisfied by ^2 fan speed progression and I want my fans running all the time at some minimal speed - not to turn off at all)
First we set "powersave" governor to slow down CPU and if that doesn't help then we halt the system.
Changes start somewhere around line 233:
Code: Select all
if (( $tval <= $mint ))
then pwmval=$minso # at specified mintemp fan keeps working
elif (( $tval >= $maxt ))
then pwmval=255 # at specified maxtemp switch to 100%
if (( $tval >= 50 )) # if temp is over 50 slow down CPU
then
if [ ! -f /tmp/slowed.down.by.tnt ];
then
echo -n "powersave" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
touch /tmp/slowed.down.by.tnt
date >> /var/log/heat.log
echo "Set powersave governor..." >> /var/log/heat.log
echo -n "CPU temperature: " >> /var/log/heat.log
cat /sys/devices/platform/i2c-0/0-0290/temp1_input >> /var/log/heat.log
echo -n "System temperature: " >> /var/log/heat.log
cat /sys/devices/platform/i2c-0/0-0290/temp2_input >> /var/log/heat.log
rm -f /var/www/localhost/htdocs/monitor/index.cgi
cp /var/www/localhost/htdocs/monitor/alert.cgi /var/www/localhost/htdocs/monitor/index.cgi
fi
if (( $tval >= 55 )) # if temp is over 55 then halt the system
then
date >> /var/log/heat.log
echo "Shutting down system because of overheating..." >> /var/log/heat.log
/sbin/halt
fi
fi
else
# calculate the new value from temperature and settings
# ^2
# pwmval=`calc "(((${tval}-${mint})/(${maxt}-${mint}))^2*(255-${minso})+${minso})" |cut -d'.' -f1`
# ^1.5
pwmval=`calc "(((${tval}-${mint})/(${maxt}-${mint}))^1.5*(255-${minso})+${minso})" |cut -d'.' -f1`It works perfectly for more than two weeks on my home server. I've tested switching from "ondemand" to "powersave" by setting trigger temperature low and everything went just as it should. I haven't tested complete system shutdown by /sbin/halt, but I guess it works - it so simple.
Any comments about all this mess I've made?

