Too much of an upstart

Submitted by Larry on 8 October 2006 - 9:45pm

So it seems Ubuntu, a distribution I have grown to like more and more of late (especially every time something breaks in Debian Sid), has decided that init has got to go. Their answer? Not any of the various attempts to replace it in the past, but once again start from scratch with something called Upstart. While I agree that init is one of the many parts of typical GNU/Linux system that desperately needs to grow out of the 1970s, I'm not sure that Upstart is the right way to do it.

Upstart differs from init and most of its replacements in that it is entirely event-based. init, for instance, is simply a collection of start up and shut down bash scripts. Each runlevel is a collection of symlinks to those scripts. Switch into a runlevel and the init process runs those scripts, and they do whatever they do. Dependencies? Scripts are run in alphabetical order(!) by their symlink, so you just name the symlinks with numbers at the beginning and they run in the order you specify.

Conceptually very simple, and not very resource intensive; both good things when you're working on 20 MHz and are happy to have it. When you have hardware coming and going all the time, though, it tends to break down. USB (still dangled off of the SCSI chain for no good reason other than sloth) gets plugged in with a different configuration constantly. Same for Firewire. Removable flash cards are here-today-gone-tomorrow IDE devices (unless they're over USB, when they're SCSI devices). And let's not get into printers, USB speakers, handhelds, cameras, and godforbid WiFi.

Certainly, init needs to be replaced with something less hacky. Unison takes an event-based approach. Anything that starts will start when an event happens that makes it necessary or possible. Apache starts on the "network works now" event. The network starts on the "hey, there's an ethernet card" event. X starts on the "hey look, a video card" event (which can happen in parallel with the network starting up). And so on.

Sounds great. Much more elegant, events are a wonderful concept, and it ensures that things are started when they need to be and not before. The problem is that it also ensures that things are started when they can be, not when they need to be. Just because I have a network connection doesn't mean I want Apache to run. Just because I have a video card and I have X doesn't mean I want X to start. Odds are they won't break anything, but they are a waste of resources.

For a "novice user" desktop, like Unbuntu is targeting, that's probably OK. Burning extra RAM on a process you're not using won't stop you from doing normal tasks. But when you start running a lot of them, running extra stuff in the background that you don't need becomes a problem.

It's more of a problem, then, on a workstation or server. Like, say, Ubuntu-server. That could also be a problem for adoption by other distributions. If Ubuntu goes off its own direction with its start up system, that means they have to maintain alternate versions of everything that touches the start up system unless it becomes the new de facto standard to replace init. Will that happen if it has problems with starting to much? I question if it will happen even without that problem, simply because the Linux community has a hard time moving past the 1970s as a group in general. See also: Device handling.

Perhaps the Ubuntu folks have an answer, and it's not as much of a performance issue as it sounds. Hopefully that's the case. I am looking forward to the base Linux userspace world getting a much-needed makeover.

Presumably it would have some way to configure what you want to start when something is available. For instance, there are a lot of people who like to have Gaim startup when the computer boots up. Maybe some people want Apache to always start (like me), but obviously there will be plenty of people who won't want it to happen automatically.

At least with init, it works alphabetically. On Windows, I've seen different things startup in different orders between reboots, and there really doesn't seem to be any logic to why one would start before the other. Hopefully if Upstart is much more elegant, it does catch on.

Then all we need to do is get single-user desktops to act like single-user desktops instead of multiuser-mainframes-being-used-by-one-person, and the Linux-based desktop can gain some headway. At least, it is how some people think. I don't know enough about the topic to say why it should be one way or the other.