Project 4: Fix For IBM T-40 Overheating Problem
A couple of weeks ago, I mentioned some of the problems I was having with my IBM ThinkPad T40. One day, out of the blue (as these things typically happen), my system randomly shut itself down with about five seconds of warning. Exciting! This happened repeatedly over the course of a day - specifically, whenever I tried to recompile my local Ikiwiki build.
At first, I thought it was the battery, but no. Then, perhaps the power supply, but that wasn’t it. Finally, someone suggested that it could be a fan problem. I removed a few appropriate screws from the bottom of the laptop and lifted out the keyboard only to find that the fan was working just fine.
Curiouser and curiouser.
The next step was to tell the fan to just stay on all the time. I’m running openSUSE 10.2 on this laptop, so after switching to superuser mode, I keyed in this:
echo enable > /proc/acpi/ibm/fan
And just to make sure that it was doing its job, I keyed in this:
watch -n 0.5 acpi -V
This polled the system every half second to check the processor’s temperature. Then I ran the ultimate test: I recompiled the Ikiwiki build to see if the system would overheat again. Up the temperature crawled: 65 degrees C, 75, 80, 85, 90 - and the fan kicked on and down the temperature went. Success!
Sort of. Then every time I logged on, I had to go through those same steps. So, I opted to write a little script and then added it to my /etc/init.d/ directory so that it would load every time I booted up and logged on. Thanks to Dave Taylor’s “Wicked Cool Shell Scripts” I had a general idea of how to structure the script. (Though I must admit the simplicity of this is all mine; Taylor would have added some testing of some kind and shown a bit of flair. Mine is basic, rudimentary, not sexy at all and likely incomplete. Give me time!)
Here’s the script:
#!/bin/sh
# this is a script to make sure that the fan comes on automatically on login/bootup
sudo echo enable > /proc/acpi/ibm/fan
exit 0
To test it, I rebooted, then logged back on. I skipped the step where I kicked off the “echo enable” by hand, so to speak, and went right to the command line to recompile the Ikiwiki build - the best way I could think of to max out the processor. 60 degrees, 75, 88, 90 - and the fan kicked on. Success again!
To clean this up, I should find the best way to verify that the script actually runs the desired command (nothing shows up when I key in “ps -aux”), but that’s for another day. For now, my system doesn’t overheat and I can actually get some work done.
One project down, four to go!
Additional Note: Just to be sure, I ran Yast2 (specific to openSUSE distros), selected “System” and checked in the “System Services (Runlevel)” section to make sure that my script was listed. It was there, but it was not, however, enabled. Once I enabled it, I tested “stop” and “start”, then made sure to add it to runlevel 5. While I still haven’t figured out how to verify at the command line that things are working correctly, I have managed to get the system to run my script on when I log in.
July 21st, 2008 at 8:24 am
Cool, so my scripts are witty with flair and sex appeal? Wow. I had no idea…
Thanks for the kudos.
July 21st, 2008 at 11:39 am
Sexy Scripts of Flair! Yup, that’s you!