Sunday, February 25, 2007

Grub vs Lilo

Every six months (or so) when I upgrade to the next version of ubuntu this little contest replays itself. Every time I think to myself, maybe THIS time I can replace lilo with grub. And every time grub loses.

I don't know why. It is not like I don't make an effort. Maybe my hardware is just weird, although even that seems unlikely: It is a pretty standard via chipset with a seagate SATA drive.

The symptoms are pretty much the same. Grub fails to boot the machine. It fails to get to stage2, I never get the menu or the shell, just an error message: GRUB Hard Disk Error. I go through the motions tree or four times, then I give up and install lilo, which always works first time.

I must admit that grub works fine on other systems, but somehow lilo is still my trusted champion. For all it's inflexibility (not being able to edit things at boot time) I find it to be way more flexible than grub.

During a short stint with OS/2 I learned that the idea behind grub isn't really new. OS/2 had it for ages. FreeBSD too. The idea being that the boot loader has the ability to read the filesystem, which means more flexibility at boot time, as opposed to the static block-based method used by more primitive loaders. Specifically, the OS/2 loader makes use of a mini-ifs (installable filesystem) that contains just enough functionality to read the required parts of the filesystem: the OS/2 kernel and CONFIG.SYS. From CONFIG.SYS it later obtains the correct drivers to load, one of which is the real IFS that provides full support for the target filesystem. One clever bloke actually wrote an IFS for ext2, which means you can run OS/2 from ext2.

Yet this ability to read the filesystem is always limited to some extend, and while useful, there is still great complexity involded as the tiny MBR can hardly contain everything needed to boot into a bootloader shell. I suspect my problem with grub is probably the inability to find stage1_5 or stage2, which means that is suffers pretty much from the same problems lilo often suffers from, except that it occurs so early in the boot cycle that it loses all it's so called benefits.

If grub was to offer me any other benefit I might even work a little harder at getting it going, but I really just want the machine to boot. I cannot for the life of me see any point in spending hours getting grub going when lilo will do the job right here and right now.

So I'm back with lilo until feisty makes it onto this here machine... when I'll probably go through this excercise again.

Sunday, February 18, 2007

De La Rey

The song "De La Rey" by Bok van Blerk has been in the news almost every day of the week for two weeks now. People have even speculated that it might contain a hidden message for Afrikaners to start a revolution (conspiracy theories always make me laugh). Tonight it made it into the MNet news program called Carte Blanche.

It is perhaps wise to admit at this stage that this song is indeed used by some people to push a political agenda. Even though the song tells of the Afrikaner's suffering and perseverance against the british, people see black rather than british when they listen to it.

I have to agree that Mr. van Blerk is a bit naïve when it comes to politics. His admission that he would perform the song even to members of the Boeremag, if they were to pay him for it, was probably a bad idea.

There is a much bigger problem here though. If this song was to start a revolution -- as some people seem to fear -- blaming the song for the revolution would be like blaming the last piece of straw for breaking the Camel's back. If you already have a situation that is just one song away from a revolution, you have bigger problems than just one artist.

The question at this point would be, is there really a problem? Are we really just one song away from a revolution? I would say the answer is a definite NO. Do the Afrikaners feel the need for some kind of change? I would say they certainly do.

The Germans have been guilt-ridden for decades because of what they did to the Jews. They have been denied any national pride for such a long time that it is becoming a problem. Granted, what they did to the Jews was at least an order of magnitude worse than what happened under Apartheid (regardless of what Cosatu wants you to believe) but I think we can agree that many similarities do exist.

Does such shame even make sense?

After WWII the average German's defence was simply: "Aber wir haben nicht gewüsst!". We didn't know! Most people feel that this is not an acceptable excuse. But personally I feel it is just taken too far. How about I say to you: I was nine years old at the time and I REALLY DIDN't KNOW! That good enough?

I think it is about time we get rid of the guilt...

Endurance tests

Every now and then you'll here that some or other motor manufacturer is doing an endurance test on their vehicles. Usually this takes the form of taking a couple of their vehicles, and driving it at constant high speeds over long distances.

These endurance test probably serve a function to the sort of person who drives his vehicle in town most of the time, and goes on holiday no more than a couple of hundred kilometers away from home. It is lost on me though. At one point I used to drive to Windhoek in Namibia twice yearly. This is a distance of 1500km, which I would normally complete in a single day, usually driving between 120 and 140km/h. Of course I am not doing the high speeds those endurance guys are doing, but I've done this to my vehicles on so many occasions that it surely proves the reliability of the vehicle more than those endurance tests.

I heard this story form a friend: A couple of Japanese people came to South Africa at one point to test a vehicle. The test called for testing it at no more than 60km/h on a gravel road. While they were doing this, that had a jaw-dropping moment as a farmer raced past in an old model Hilux, doing well over a hundred. Apparently, or so I am told, they were equally amazed at what taxi drivers do with those Hi-Aces!

Ja, these Toyotas are tough! Not only the Toyotas though. Almost any modern vehicle is an amazing piece of engineering.

Fuel Consumption

In December I pulled into a Shell Ultracity and they handed me a very handy logbook, which I've started to use. It has always been a habit of mine to calculate the consumption at the pump just after filling up, but usually I would just go "mmmmh, a bit lower than usual" or something like that and forget about it.

The interesting bits I gathered from writing it down is that aircon seems to be the biggest drain on fuel. On the 20km commute to work, I normally get arround 12 to 13 km per liter, doing arround 100km/h on the R44. During those extremely hot days in January, this dropped to about 11.3 km/liter. On a cooler day (using the econo setting on the airconditioner), doing 130 km/h on longer distances, I'd get as much as 13.7km per liter.

The best figure I got was on an early morning trip from Windhoek to Mariental (it was quite cold that morning), almost 16km per liter. Second best was a trip from Namibia to Pretoria via Botswana (arround 1100 km) which averaged 15km per liter (mostly because it was a cool day and Botswana has very strict speed enforcement).

It would seem that the biggest factors in fuel consumption is in order 1) Air Conditioner, 2) speed and 3) weight on board.

Wednesday, February 07, 2007

Driving in a parking lot

I learned to drive on a farm. The good thing about learning to drive on a farm is that you have to know where your wheels are, because they have to fit in the tracks. The bad thing -- for me at least -- is that for economy reasons my father wouldn't tolerate any unecessary driving in lower gears. I had to learn to drive in top gear whenever possible, which means I learned to drive fast on those dirt roads. It also meant first gear was used only for pulling away, after which second was imediately engaged.

Fast forward a couple of years. I bought my own car shortly after I started working, and the habit of not driving in a lower gear unless absolutely necessary was still alive and well. What this meant for me, is that I'd rather drive in second gear at low engine speed than drive in first gear. This means I'd drive arround parking lots in second, doing between 15 and 20 km/h. My girlfriend (now my wife) kept complaining that I'm driving too fast and said I'd hit someone if they suddenly stepped out from behind a vehicle. I dismissed it, naturally.

Then I did the math. If you're doing 15 to 20km/h, it means you're moving between 4 and 5 meters per second. Average response time is about a second (it sounds slow, but that's the reality). That means if someone stepped in front of me less than 6 meters away, there would be NO WAY to avoid hitting him.

I therefore had to admit that my girlfriend was right, and learn to drive arround in first gear when roaming a parking lot, looking for that elusive parking spot.

Tuesday, February 06, 2007

How the municipality lets me have one cold shower per year

It happened again this morning. No hot water because the geiser (hot water cylinder for the foreigners) was turned off all night, caused in turn by the municipal ripple switch that was turned off all night. Now while this saves a bit of electricity, it seriously irritates the wife, which in turn seriously messes with my early morning wake-up routine (a rather slow routine). A cold shave is also no fun at all.

But at a frequency of once yearly I suppose I can put up with it for the feel-good value of helping our struggling supplier to regulate what is slowly becoming a scarce commodity.

Saturday, February 03, 2007

Monit

Getting a little tired of this software. Monit is supposed to monitor services, let you know if they go down, and restart them if possible. In practice, monit goes down by itself (usually under high load), fails to notice that processes have recovered, and doesn't play well with zope.

It doesn't play well with zope because it does a restart like this: First it calls the stop program you specified (usually /etc/init.d/servicename stop), then it calls the start program you specified, and then it immediately checks if the service is up. In the case of zope, it takes a while to start up and bind to a port on the network, so this check fails. Monit then assumes that execution failed and retries.

There is also the insane dependency handling. It starts with squid. Zope can behave like an upstream cache, that is, squid can talk ICP to it. Squid doesn't always notice when a backend zope returns from the dead, so you need to reload the config to make squid notice. I cponfigured monit with a service called squidreverse, a custom check that makes sure that the backend zopes are reachable via squid. Since the check will only succeed if the backend zopes are actually alive, I made squid depend on the zopes. I then found that if a zope process goes down, monit will stop squid, then restart zope, and finally restart squid again. Not what I wanted.

I also made a plugin for nagios that can check monit instances. Unfortunately the latest version of monit checks itself, and sees a restart as a problem, reporting a false error to nagios.

I'm therefore going back to nagios for monitoring services. It may be a bitch to set up, but I love the control.