Thursday, 9 February 2006

Services, for better or worse

Having recently installed MySQL on my Mac OS/X Tiger laptop for use with some software I have been testing, I decided to have a look at launchd and get MySQL starting at system startup.
Reading through all the launchd and related documentation I am rather suprised. Why is it that Apple have decided to remove the dependency feature that StartUpItems had. According to Apple:

In the long run, Apple recommends designing daemons to not depend on the order in which they are started. Programs should be robust in the case where a service is unavailable, and in some cases, programs should be automatically spawned when needed instead of requiring programs to wait for them.
Surely only a tiny minority of sysadmins actually write the daemons that they are expected or need to run as a service. So what good is apple encouraging developers to write robust code, when developers are not the main audience for launchd setup.

While I'm expressing my disappointment, why have both Apple and Sun, in pretty close succession, decided to re-implement all the tried and tested *nix service and scheduling stuff in totally different ways. I mean, they both seem to be trying to achieve the same things. And it's not like they haven't both worked towards open systems and on open standards before. Surely if they came together to create something they could both use in their at least partly Open operating systems it would be great for everyone. OK, so Linux might then use the technology, but they could spin that as a "we're so great even Linux uses our code" rather than worrying about it. If everyone does everything differently people are going to try and stick with good old cross-platform daemontools, xinetd, cron and rc.X scripts. After all they still provide fairly configurable and robust services, scheduling and startup too don't they. OK, so they don't use XML to make config verification easy, and they don't provide some things like Apple's WatchPaths but at least everyone knows how to use them and you can use them on any *nix platform. If I wanted to be cynical, I could even suggest that Sun's approach is mostly not for improvement of configurability or reliability, but a way to make it easier for them to bolt their commercial monitoring and "self healing" products onto a system. As to Apple, well you could cynically suggest that they are moving in the same direction, or simply want to be different.

Let's just hope this isn't the start of a massive divergence of *nix platforms. I'm all for improving things, but part of the beauty of *nix is that once you've used one, you've used them all. And if another system does something differently, you can normally just bring your preferred method of doing it with you. After all Solaris didn't used to have xinetd for ages, but you could always install it yourself. And package management on Linux has lots of guises, but most of them can be used on any old Linux distribution without much fuss. Good grief, you can even make your Windows machine look like *nix with cygwin, including running things like SSHD.

Anyway, now that my rant is over, anyone looking to run MySQL as a service on Tiger should look at my Wiki. It has the plist file I use and some general info around my experience.

No comments:

Post a Comment