Friday, April 17, 2009

Cooling Down Your Hot iMac G3 Server

I had a post here long ago about how the local ACM chapter handed me two old iMacs. About time I did something with them! :-)

Well, one of them, the faster one, got a CD stuck in its throat, so that's something for a later post. Slot-loading drives be damned! But the really old one, the original Series A iMac they gave me, is alive and kicking: Meet Zach!

As you can see, I am running Gentoo Linux on it instead of my usual choice for old machines, NetBSD. Turns out that NetBSD is a real bummer on these machines and that Gentoo just worked right out of the proverbial box. I even did the install remotely and it booted properly the first time, something that never worked out for me before. Excellent!

Well... Not quite. :-( At first I had the same problem I had when I ran NetBSD: the display wouldn't shut down. Now these old iMacs get really, really warm when the display is on. Not actually hot, but really, really warm. So running that thing as a 24/365 server wasn't really an option at first. But now it is! :-)

Thanks to my pal uber, I figured out how to make the monitor power down. Now I have a quiet and cool PowerPC server, just the thing I needed to be a little happier. Here's how you do it:
setterm -powersave powerdown
setterm -powerdown 1
setterm -blank 1
For some reason I had to do all three, not exactly sure why the last one is needed. But in any case, now the display shuts off after one minute. You have to run these from the actual console, but you can also add them to whatever local startup file your Linux distribution uses. On Gentoo, you can slap them into /etc/conf.d/local.start for example. Presumably your kernel has to support power management somehow (not really sure about that). Just in case I checked my kernel configuration, and the only thing related to power that I have set seems to be this option:
As far as I can tell, one kernel option (which is a default on most Linux distributions I think) and three commands in a local startup file is all it takes: You can all turn your old iMacs into sexy servers now! So join the revolution! :-)

Zach has been running for about two weeks without any problems, heat or otherwise. The only painful thing with Gentoo is that everything gets compiled from source, which can take over a day on a slow box if you have to build gcc as well. Hint: USE="-fortran" is your friend. Eventually I'll look into distcc more seriously so modern boxes can do the grunt work instead of those tiny little PowerPC chips. Probably a blog post for next year...