Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Kernel & Hardware
  • Search

Emergency shutdown on overheat

Kernel not recognizing your hardware? Problems with power management or PCMCIA? What hardware is compatible with Gentoo? See here. (Only for kernels supported by Gentoo.)
Post Reply
Advanced search
5 posts • Page 1 of 1
Author
Message
tnt
Veteran
Veteran
User avatar
Posts: 1231
Joined: Fri Feb 27, 2004 11:57 pm

Emergency shutdown on overheat

  • Quote

Post by tnt » Thu May 05, 2005 2:16 pm

AMD Athlon64 3000+ (Winchester core) Socket 939
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`
/var/www/localhost/htdocs/monitor/index.cgi is soft link to my home page and I change it into page with red (#FF0000) background so I can see something wrong happened. I couldn't send mail to myself in that situation because I haven't got postfix running yet.

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?

:lol:
gentoo user
Top
trinity
n00b
n00b
Posts: 74
Joined: Thu Mar 20, 2003 5:39 pm

  • Quote

Post by trinity » Tue Sep 13, 2005 12:15 am

Hi,

I built a water cooling system for my pc and so far it working pretty well! I'm looking for a script which can check my cpu temperature and if temperature is too high (>55 C) then do a shutdown (in case my pump stop working or whatever). I checked my bios and it can't do it. (it will shutdown pc only if fan stop working).

I'm not a programmer so I don't know if you can help me for a script about that?

Thanks.
Top
tnt
Veteran
Veteran
User avatar
Posts: 1231
Joined: Fri Feb 27, 2004 11:57 pm

  • Quote

Post by tnt » Tue Sep 13, 2005 1:36 am

I've made the script that does same thing from /usr/sbin/fancontrol (it comes with lm_sensors).

Changes I've made to the original fancontrol script are described in the first post.
You just have to compare original and the code I've posted to see what I have done.

It works just as it should, at least for now :D
gentoo user
Top
trinity
n00b
n00b
Posts: 74
Joined: Thu Mar 20, 2003 5:39 pm

  • Quote

Post by trinity » Wed Sep 14, 2005 12:46 am

tnt wrote:I've made the script that does same thing from /usr/sbin/fancontrol (it comes with lm_sensors).

Changes I've made to the original fancontrol script are described in the first post.
You just have to compare original and the code I've posted to see what I have done.

It works just as it should, at least for now :D

Hi,

Ok, I replaced the lines with your code. Now, do I need to call this script when I reboot?
If I run the program "fancontrol" I get this:

Loading configuration from /etc/fancontrol ...
grep: /etc/fancontrol: Aucun fichier ou répertoire de ce type
grep: /etc/fancontrol: Aucun fichier ou répertoire de ce type
grep: /etc/fancontrol: Aucun fichier ou répertoire de ce type
grep: /etc/fancontrol: Aucun fichier ou répertoire de ce type
grep: /etc/fancontrol: Aucun fichier ou répertoire de ce type
grep: /etc/fancontrol: Aucun fichier ou répertoire de ce type
grep: /etc/fancontrol: Aucun fichier ou répertoire de ce type
Some mandatory settings missing, please check your config file!

Is it normal?

Thanks

EDIT: I just see I don't have /etc/fancontrol file!! :roll:
Top
tnt
Veteran
Veteran
User avatar
Posts: 1231
Joined: Fri Feb 27, 2004 11:57 pm

  • Quote

Post by tnt » Wed Sep 14, 2005 9:25 am

you should run pwmconfig first:

http://secure.netroedge.com/~lm78/man/pwmconfig.html
http://secure.netroedge.com/~lm78/docs.html

that script will generate /etc/fancontrol file for you
gentoo user
Top
Post Reply

5 posts • Page 1 of 1

Return to “Kernel & Hardware”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic