Kill, kill, kill!

Ok, so I notice that my CPU load is pretty high while the computer wasn’t really supposed to be doing much. I check out what is wrong and notice that I have a Totem process eating more than 80% of the CPU.  Okay, I did watch a movie yesterday evening, so it is not that weird to have Totem running. Something must have gone wrong when I closed the program, but no worries, I’ll just terminate the process now.

I send it a gentle HUP signal to let it know that I want it to shut down.  That doesn’t work.

Okay, no more mister nice guy; I send it kill -9.  That still doesn’t work!?!!

WTF? kill -9 means EAT FLAMING DEATH, PROCESS! It tells the OS to kill the process immediately. No questions asked.  It doesn’t “inform” the process that it should terminate. There should be no way for a process to survive a kill -9, but my Totem process is running happily along.

I had to reboot the machine to kill the process.  That is just not right.

What is going on here?

Apparently I am not the only one with this problem, but I haven’t figured out what is causing this problem or how to avoid it :-(

Extracting .lit files

I have a bunch of ebooks in Microsoft’s .lit format, but I want to read them on my Linux box.  I tried installing Microsoft Reader through wine, but that doesn’t work for me.  It will pop up and crash down again just as fast.

I used to use the Openberg Firefox addon, but it has not been updated to Firefox 3 so that is not an option any more.

So now I just need to extract the files and then I can read the damn books as html.

There’s a program for doing this called clit (really it is, I am not making it up).  You can get it here.

To make it sligthly easier for me to extract the files I wrote a small script:


for litfile in "$@"; do
    dir=`dirname "$litfile"`
    outdir=$dir/`basename "$litfile" .lit`/
    clit "$litfile" "$outdir"

and added it to my nautilus-actions.

Excellent, now I can just right-click on the files I want to extract, and viola I have the html hidden under the .lit file.

Update on my swapping woes

I feel a bit embarrased about the ranting and complaining about Linux yesterday, ’cause as it turned out and as suggested by most of the commenters, on Linux you actually have the tools to fix the system when it is broken.

And broken it was, but only on my box.

The comment that sent me down the path to solving the problem was this one:

Marc Paradise Says:

You can reduce linux’s annoying tendency to swap out too fast:

Here are some instructions on how to do this for ubuntu:

See, at the time I thought my problem was that the system was swapping way too much, to the point where I couldn’t get in contact with it.  That is how it behaved.  It would run out of RAM, the disk would be spinning, it would slow down to the point where I couldn’t interact with the machine.

So reducing swapping might crash some programs if they run out of memory, but at least I would be able to interact with the system.

Sounded like just the thing to go for.

Well, when I followed the instructions I came to this command, with this troubling error:

$ sudo swapoff -a
swapoff: cannot canonicalize /dev/disk/by-uuid/d00bfdb4-c541-4d56-8448-b0a13ce352a8: No such file or directory

Ups, something is wrong here.  Could it be that the system doesn’t know where the swap partition is?  I checked the system monitor and to my horror found that it uses 0 bytes of swap, even when I am trying to fill up the RAM with all the applications I can fire up.

Yep, something is wrong here.

I googled for “swapoff: cannot canonicalize” — I find that googling the error message usually leads me to the answer faster than actually thinking about it — and then I hit this thread:

I followed the advice there and update /etc/fstab and viola, my swapping is back up (well, after running swapon -a).

If I stress the system now, of course some tools slow down as they are swapped out, but the behaviour is no where near what it was earlier.

Why the symptoms earlier looked like swapping rather than crashing applications I don’t know, but I don’t really care either.  I’m just happy to have a stable system back.

Sorry for ranting, Linux, in the end you came through for me :)

Ranting online

Earlier today, I ranted about Linux. Just now, I read Andrew Sullivan’s Why I Blog. That got me thinking…

The quotes below are all from Andrew.

We bloggers have scant opportunity to collect our thoughts, to wait until events have settled and a clear pattern emerges. We blog now—as news reaches us, as facts emerge.

Sometimes, I need to let off steam.  Those who have ever shared an office with me, or been in an office close to mine will know this.  I am pretty vocal about it, when something is annoying me.

I’m not being particularly rational about it.  I just complain a lot.

I calm down again pretty quickly, once I’ve stopped screaming and hitting the walls, but when I am frustrated about something, I do need to let off steam.

On my blog, that “steam off letting” is tagged as Rants.  Now you know, so consider yourself warned.

Alas, as I soon discovered, this sudden freedom from above was immediately replaced by insurrection from below. Within minutes of my posting something, even in the earliest days, readers responded. E-mail seemed to unleash their inner beast. They were more brutal than any editor, more persnickety than any copy editor, and more emotionally unstable than any colleague.

Now, complaining about Linux will annoy some people.  A lot of people feel strongly about it.

Not that the comments on the Linux rant are unfair in any way.  It is more that my actual rant was unfair, and the comments are actually quite fair!

Not long ago, I would would have defended Linux strongly against just about any criticism. I was a strong believer in Linux.  And it has gotten better and better since I started using it.

Why, then, do I complain so much about it now?

Two reasons, probably.

First, I’ve had a lot of problems with using it as a desktop computer that I am just not having with my new Mac.

I got an iMac a few months back, and this is the first non-Linux OS I’ve done any serious work on since I started using Linux in 1995 and so far it has been a pleasant experience.

Not all pleasure, of course.  It takes some getting use to, and quite often I get annoyed when it doesn’t work exactly like what I am used to on Linux.  And don’t get me started about the problems I’ve had with Boost and Xcode.

Still, fighting with drivers and whatnot is something I avoid on the Mac.  Probably a good thing, ’cause I wouldn’t know where to even start with that…

You can’t have blogger’s block. You have to express yourself now, while your emotions roil, while your temper flares, while your humor lasts. You can try to hide yourself from real scrutiny, and the exposure it demands, but it’s hard.

That’s the second point (about why I am complaining now).

I was just pissed off that I had to reboot my laptop twice the same morning.

A blogger will air a variety of thoughts or facts on any subject in no particular order other than that dictated by the passing of time. A writer will instead use time, synthesizing these thoughts, ordering them, weighing which points count more than others, seeing how his views evolved in the writing process itself, and responding to an editor’s perusal of a draft or two. The result is almost always more measured, more satisfying, and more enduring than a blizzard of posts.

If I had waited with my ranting until this evening, I probably wouldn’t have ranted at all.

Of course, then there wouldn’t have been this discussion, and that would have been a loss.

I really do appreciate all the comments.

Words, of all sorts, have never seemed so now.