Upstart in Ubuntu 9.10

Upstart is the ‘new’ event-based sysvinit replacement by Canonical, that has been widely adopted in the linux world ever since it first appeared in late 2006. The idea is centred around causality, that is, defining relationships that are not loosely defined by some measure of time, but by the presence (at runtime that is) of processes that a service depends upon. For example, if you need service X to run after service Y, you shouldn’t have to ‘wait’ for Y to start before starting X, but, instead, you should be able to specify that X depends on Y in some canonical form and the system would try to start X as soon as Y was up and running. In other words as a user/administrator of a machine you shouldn’t have to go through all that S?? and K?? silliness from SysV.

Upstart is by no means the first such service management system; Apple has incorporated its own version of such a system, called launchd, since the mid 2000s and so has Sun Microsystems with SMF. In fact, launchd was considered as a sysvinit replacement for Ubuntu 6.10, before Upstart was anything but a crude replacement for the /sbin/init daemon, but the idea was scrapped due to licensing issues (launchd was at the time licensed under the somewhat controversial Apple Public License; it has since been relicensed under the Apache License).

In the upcoming Ubuntu 9.10 release Upstart has reached another milestone, ‘just’ three years since it first made its appearance as a project; a number of core scripts have been rewritten as Upstart jobs (yay). Despite the fact that Upstart has been adopted by a number of systems (including Fedora, Maemo and — soon — Debian, among others) there are numerous issues (and practically no documentation for most of the system) as well as extreme volatility in both the format and structure of Upstart jobs and — alas — the aimed featureset. The only thing that’s been ‘stable’ in Upstart is the actual daemon, while the configuration/job format has been changing (and being moved around) every few months.

The problem here is that it’s dumbfounding how most major ‘vendors’ of GNU/Linux distributions equally depend on such a system and how no-one is putting any effort in getting this done. To the end-user (and given the lack of documentation to practically everyone not bothering looking at the source code) Upstart has been nothing but a sysvinit-like daemon for more than three years.

I’m pretty sure that Upstart is most certainly going to offer a lot of the linux community in the future. On the other hand, as with so many other promising open source projects, its development pace is slower than molasses, unstructured and undisciplined and makes me (at least) wonder what exactly the commercial linux ‘vendors’ are thinking when they clearly fail to support, finance and expedite the development of solid foundations upon which most of the ‘fancier’, ‘prettier’ and more humane features could be built.

Fortunately, in this particular case, a solution might be possible: Ditching Upstart and adopting launchd might make more sense, given the practical non-existence of Upstart as a complete, functioning, open source and usable system, but especially given the maturity and stability of launchd (even at the cost of a marginally inferior feature set), leaving aside the fact that people can actually use it *today* without resorting to reading ever-changing source code or waiting in perpetuity for a way to write and manage their system services.

I’m saddened that it’s late 2009 and I bet that in one year’s time Upstart will be so marginally improved that this post might need minimal changes to be current. I’m very much looking forward to losing that bet.

Creative Commons License

9 Responses to “Upstart in Ubuntu 9.10”

  1. Panagiotis Atmatzidis says:

    Launchd’s documentation on apple’s developer connection as well as macosforge is far and away from complete imho.

  2. cosmix says:

    @atma: I agree. Still, the implementation of launchd is stable and mature, the feature set solid and ready, the job description format has been finalised for years and, even if the documentation is not comprehensive, it’s still much better than Upstart’s. So what’s your point?

  3. Panagiotis Atmatzidis says:

    Heh, weird timing… I’ve read good things about launchd from many people but I fail to see them in practise for the time being.

    My point is that it’s easier to discuss about then actually use it.

  4. cosmix says:

    I think you’re confusing things. launchd replaces a great number of services, including (x)inetd and cron. Upstart doesn’t even do startup properly yet, and only *wishes* to replace cron in the future, while there is an off-chance it might tackle (x)inetd at some point (maybe a few decades down the road).

    Now, you describe your issues with launchd, when using it as a cron replacement (I also think that you exaggerate and that although the 60-second delay is a nuissance, it is a very minor one, especially compared to everything else out there; but that’s just my opinion).

    Anyway you cut it, whether you had trouble creating a single-line shell script or not, whether you found launchd too complex or undocumented, there can be no comparison to Upstart; and that was precisely the point of the article; not that launchd is the best possible system and certainly not that it doesn’t have its problems. It’s just years ahead of Upstart and will probably remain so as long as Upstart keeps improving at the rate it does.

  5. Hourback says:

    I would LOVE to see something on Ubuntu’s site about switching to launchd!!!!! It shouldn’t take so long to switch to a better option. Also, it’s unfortunate that A) real innovation seems only to come from such commercial projects and B) it is not sooner recognized and pounced upon by the open source community. OF COURSE, I might be completely wrong about that but it is my perception. :-)

  6. Panagiotis Atmatzidis says:

    Actually, what do you mean by real innovation? If you’re talking about hardware level I agree. If you’re talking about software, I remember using most of the eye-candy tools, that OSX is proud for, under Linux as early as 2003. Widgets, indexing (spotlight), etc where all available to the linux community as (very) ugly hacks. So, usually the did not work as they should do. Most of these *toys* were hard to install and tricky to work properly. Took ages to configure all of them properly. I still remember having issues with transparencies. At the time transparency was not supported by most terminals, gkrellm skins, etc.

    However, linux always seem to fail to make it *good for not-geeks*. Why should a spare-time programmer who makes a tool for himself and for his (technologically) equals care about “regular users” after all.

    The ideas, though are not Apple’s nor Microsoft’s. Most ideas for every feature, little and/or great, imho came from the world of GNU/Linux and the open source community.

  7. cosmix says:

    @atma: I don’t think so. You write:

    Most ideas for every feature, little and/or great, imho came from the world of GNU/Linux and the open source community.

    That’s as far from the truth as possible actually. If anything linux has lagged behind OS X (and Windows) in the ideas game in many respects and at all levels, and to make matters worse that rings true even at the kernel/systems programming level. Take for example the scheduler — which up until a few years ago and despite linux’s performance advantages over xnu at the time, still performed miserably on a large class of (desktop) applications and there was no interest (and few ideas) in making it better.

    Yes, it’s true that *some* great ideas stem from open source communities around the world; yet many amazing ideas first appear in commercial applications. And many more *usable* realisations of those ideas come from commercial organisations.

    But in any case, you’ve completely missed the point; hourback talked about *innovation*. Having a great idea does not qualify as innovation, and most definitely not what hourback was talking about; ideas are cheap, implementations/products cost. Innovation is having/getting a great idea and actually making it reality. And in this respect, Apple — of all companies — has been leading in some areas for years now. Linux, on the other hand, is not exactly what I’d call ‘innovative’. It’s fun for geeks, it’s free and it’s also flexible. But innovative? Hardly. Desktop compositing came too late to linux and its still not properly integrated into the main APIs; the graphics subsystem sucked for ages under the XFree86 governance and the miserable driver support; it’s still lagging behind OS X and Windows for many of the same reasons.

    For the record (and because you’re clearly confused here): Quartz compositing was out much earlier than anything else like it (2001) and I think you’re confused because compositing on linux appeared after 2005.

    Linux hasn’t had a proper filesystem indexing/searching tool, despite the good intentions and efforts of the people behind tracker/beagle/whatever. None whatsoever. None of them work right. Mac OS X has had a very basic tool with Spotlight in Tiger since 2005 that has kept getting better and better and that is an integral part of the OS X experience. Despite having a difficult start, it works great nowadays. Rate of progress? Innovation? OS X wins I think.

    That’s exactly the case with launchd and UpStart. launchd is innovative, in that it’s a great idea with a functioning implementation (with its quirks and limitations, as with everything). UpStart has shown some great promise, but its features are not even documented, let alone implemented. Is UpStart innovative? No way, it’s as close to vapourware as possible. Is launchd innovative ? Absolutely! Since 2005 it’s provided millions of people with faster boot, unified service management and a robust, dependable codebase.

    Last, but not least, is the concept of openness that the linux community seems to dislike; it’s not bad to accept that someone did something better than you; that’s exactly what Apple did when they created Darwin or when they took KHTML and made Webkit. If Ubuntu used launchd it would not only provide a better solution to its users, but it would get an opportunity to make launchd even better. That is if it could find someone to work on it faster than the rate UpStart is worked upon that is =)

  8. nucco says:

    Hmmm. Here is a long rant about something that an end-user (such as me) doesn’t need to know, and doesn’t care about… I can boot my system. I can start and stop services. Cronjobs are working properly.

    What’s all the noise about?

    (I stumbled upon this blog while checking why tracker indexing fails consistently for me).

  9. cosmix says:

    @nucco: Actually, the miserable state of Upstart does affect starting and stopping services, as well as system performance and maintenance and it does so more than many other subsystems in linux. Irrespectively of whether you care, understand or need it, the noise is there because I, along with many others, do.

Have your say.

Write in the language of the post. Comments are meant to encourage on-topic discussion. For general comments, observations, complaints (e.g. about the site), you can use the form found in the Contact page. Make sure you've read the Terms of Use before commenting.

Comments Feed for this post Comments Feed for this entry.

DigitalOcean. Affordable, Fast, SSD VPS