Today, Linux is a beautiful thing and I typically waste no opportunity to evangelize it to friends considering a new desktop purchase. I mean, if the average user today calculates how much of his or her computer time is spent either on-line or within office applications, it seems like common-sense to buy a Linux desktop with Firefox and Open Office rather than buy expensive Microsoft products. Homer Simpson captures the sentiment best in the opening line of the latest Bart Simpson flick. Why would someone pay hard-earned cash to get something we can get for free? We're all giant suckers!
One would naturally expect that it makes even more sense for the developer community to go the Linux way, since they tend to have greater familiarity with the ins and outs of the operating system. And this is mostly true, but yet I am intensely frustrated by problems in a few sloppily developed open-source programs that are part of the official Linux distributions. I ran into one such problem this weekend, and wasted almost an hour trying, unsuccessfully, to find a solution through Google. The problem was with fontconfig, part of Linux's font system. When I upgraded from RedHat to Fedora Core 6 (Fedora 7 has the same problem), all of a sudden, I had ended up breaking the font-system for my developers. No matter how many times I tried to reinstall font-config by the book and no matter which version I used, I hit the same wall.
Calls to the library would print the ominous message:
Fortunately, Linux comes armed with a rich toolbox that lets you diagnose and, in many case, fix problems yourself. One such tool is strace, which prints the sequence of system-calls issued by a program. So after my hour of unsuccessful searches with Google, I decided to go to the next level of troubleshooting and strace my problem. I ran a stripped down version of the failed command sent to me by my developer:
Looking through the output, the root of the problem was clear:
access("/usr/local/etc/fonts/fonts.conf", R_OK) = -1 ENOENT (No such file or directory)
write(2, "Fontconfig error: ", 18Fontconfig error: ) = 18
write(2, "Cannot load default config file", 31Cannot load default config file) = 31
...
Aha! There is the culprit. I had no idea why the system would look in /usr/local/etc/fonts, when I had done everything in my power, as per the documentation, to indicate that the config file lived in /etc/fonts. But I was already at the limit of my patience with this problem and too tired to look through what was probably badly designed code. So I decided to apply the simple fix:
I now run convert and it runs, with output as clean as a whistle:
So here's another reason to love Linux. It may come with sloppy programs that are yet to mature. But it does provide you the tools necessary, in most cases, to get around these issues while the program designers work to find a long-term solution.
&