Ubuntu is pretty easy as far as regular software maintenance goes, thanks to APT. However, there’s one task which (as far as I can tell) isn’t automated.
Whenever there’s a minor update to the Linux kernel, apt-get (or GUI equivalent) will diligently download and install it. Unlike with applications, though, APT doesn’t remove the old version– because you’re running it, and bad things can happen if dynamically loadable kernel modules disappear while the system is running.
So as time goes on, your Ubuntu system collects more and more old kernels. My work laptop had over 700MB of them, and a server at work running a Ubuntu LTS release had over 800MB.
There’s a proposal to build a utility to clean out the excess, but as far as I can tell nobody has actually built it. Instead, there are lots of tutorials on how to clean out kernels manually. It’s a pretty ugly task to do properly, because each kernel is split into three or four packages, depending on your hardware–as well as the generic Linux kernel, there can be proprietary hardware drivers, backported modules, and headers for use in software development. You need to make sure that for each kernel you keep, you keep the matching versions of the headers and modules, and throw away the rest.
After doing this manually enough times, I looked to see if someone had written a script to solve the problem. I couldn’t find one, so I wrote a program to do it in Ruby. It works with plain Ruby 1.8 or 1.9, no extra gems or libraries required; it calls the standard APT utilities in Ubuntu 8.x to query the package database and do the actual work.
It also makes use of a neat Ruby feature: the Comparable mixin. I define a class to represent a version number (e.g. 2.6.15), implement the <=> operator, and import Comparable. I can then use my Version objects just like any other number, and compare them and sort them as easily as if they were ordinary integers.
The first time you run IBM Lotus Domino server on a new Red Hat Enterprise Linux (RHEL) box, you get the following message:
WARNING: the maximum number of file handles (ulimit -n) allowed for Domino is 1024.
See Release Notes and set the allowable maximum to 20000.
This message is less than ideal for a couple of reasons. Firstly, it doesn’t tell you how you’re supposed to change ulimit, and secondly it hints at the wrong way of doing it.
The wrong way is to put ulimit -n 20000 into /etc/profile, or root’s .bashrc, or even the /etc/init.d script for Domino.
The right way is to edit /etc/security/limits.conf and set up limits specifically for domino (or whatever user ID you’ve chosen to run the server under). The two values recommended are set by adding two lines to the file:
However, energy usage isn’t the whole story. According to studies the DST shift will cause around 17% more car accidents on Monday, with a smaller increase in the fall because it’s easier to sleep in than to get up early.
DST doesn’t benefit farmers either, in spite of what you might have heard. They lobbied against its introduction. Cattle don’t care what the clocks say, so DST just means the farmer has to get up and milk them at a different clock time.
For IT people, of course, DST is more annoying. It means checking every system that keeps time, to verify that it made the change on the correct date, and adjusting systems that don’t adjust themselves. That’s assuming your government doesn’t decide to change the date of the DST switchover, like the Bush administration decided to, causing hundreds of millions of dollars to be spent patching embedded systems, servers and desktops. (Since Java, Linux and IBM Lotus Domino all use their own independent time zone rule databases, I had to apply three separate fixes to some servers.)