The Old Blog Archive, 2005-2009

Archive for March, 2007

Travel and Travail

The older you get, the more boring travelling alone becomes. It’s different when you’re younger — whether you’re along or not, travelling can be a gas. But as you age, the fun factor declines. Only the first couple of days are enjoyable. After that, the scenery becomes annoying, and people’s voices start to grate. There’s no escape, for if you close your eyes to block these out, all kinds of unpleasant memories pop up. It gets to be too much trouble to eat in a restaurant, and you find yourself checking your watch over and over as you wait for buses that never seem to arrive. Trying to make yourself understood in a foreign language becomes a total pain.

H. Murakami, “A Folklore for My Generation”, Blind Willow, Sleeping Woman, London: Harvill Secker, 2006 (emphasis mine).

launchd ain’t like no daemons

It turns out that launchd, Apple’s take of rc.d and all those init stuff, doesn’t like daemons. For the traditional services to be launched by launchd as a daemon, you have to first turn off the “daemonize” option, and let launchd takes care of it for you.

So as things migrate from StartupItems to LaunchDaemons, many packages of MacPorts (formerly known as DarwinPorts) have followed suite. The problem is some services only come with daemon mode. So MacPorts comes up with a helper utility called daemondo, which launches the daemon in another process and monitors its starting up, so as to pamper launchd.

mongrel_cluster_ctl, in this case, requires daemondo (mongrel_rails comes with no-daemon mode though), because it spawns a number of mongrel processes in a daemon-like way, which launchd doesn’t like. Copy any script that involves daemondo, and turns every debug message on. Tracing launchd can be a tricky thing, you’ll need every verbosity at hand. And just skip any script that does not mention the keyword daemondo–they are guaranteed not to work.

The More One Knows…

About this I have been thinking lately: we are not human RSS readers. It is true that it’s hard to write and talk about anything these days. Anything would require at least some googling (and that does not even constitute a bit of research), and to hold an opinion risks being ignorant, because there’s always some newer, better development that one simply can’t grasp. We have this much horizon and this much capacity of digesting inflows.

My observation is that some people turn into another extreme, feeding themselves on endless feeds and latest gimmicks or technologies, or anything. In front of them it’s hard to hold an opinion, because there’s always another side that they know while you, without that much digestion, don’t. Well it might not be a bad thing though, as they’ll always remind you how ignorant you are. Your opinions and ideas will run thru their most stringent scrutiny, and then be treated as yet another piece of work in the flow.

On the other hand, that scrutiny might stifle even the least silly effort to make a noise. And one might feel that to beat them (or to join them) one also has to turn himself or herself into one that digests.

Well, I have always been the silly that makes noise that might have been heard and said and spoken over and over. Reinventing the wheel while I could join the system and leverage and leapfrog. But if I make a noise because that’s what I feel like to and feel natural to, I guess I won’t give it up to the endless human RSS feeds.

sqlite3 bombed in Rails 1.2.2

Lately I have found the an app under Rails 1.2.2 bombed every now and then, and I thought the culprit was Mongrel.

Turned out that the error was “too many open files” and the culprit was the sqlite3 connector. This ticket explains the reason, but this patch didn’t seem to go into the 1.2.2 (even though it’s fixed before the 1.2.2 release date). The resolution is either switching to Edge just for that (and starting living on the edge…) or patching it on your own. Just follow the ticket’s diff and everything’s back to normal.

I wouldn’t have been able to found that without using the UNIX tool lsof. Apparently some knowledge on the UNIX utils can definitely save your day when in need.