Ubuntu Ditches Upstart

On April 23, 2015, Ubuntu version 15.04 (code-named Vivid Vervet) was released. This is an important release, although superficially it looks much the same as the previous version. The real difference is "under the skin", as Ubuntu switches from the Upstart init system to systemd.

Init Systems

Upstart and systemd are both init systems. An init system is the first userspace program the kernel runs during the boot process and is responsible for running all other processes, services and daemons. For much of its history, Linux used the venerable System V init process, which dates back to 1983.

The problem with the old System V init process is that it was designed for a much older generation of computers. Back then, software and hardware were much less complicated and less capable too. For modern computers, the System V init process was too slow, as it didn't make the best use of computer resources.

The System V init process starts each daemon and service one at a time, waiting for each to complete its startup before moving on to the next. With multi-core processors and kernels that support multitasking, it would be much better to start these processes in parallel.

Another problem with System V's approach was that the system administrator would need to configure the sequence of daemons and services very carefully because of the dependencies that exist between them. Some services expect another one already to be running when they start. If they start out of sequence, this can cause errors.

System V's init system was great back in the day, but it's not really suitable for a modern distro.

Upstart

Canonical's solution to the slow boot process was Upstart. This init system originally was created for Ubuntu, but it was designed to work with any distro. Upstart solves the problems of dependencies and starting processes in parallel using a "greedy event-based" model. This takes a large burden off the admin's shoulders, as Upstart is able to work out the best sequence in which to load the processes. "Greedy" means that Upstart runs all jobs as soon as possible based on "events". Events occur when a process has completed its startup, and then processes that depend on it will be able to run.

So Upstart rushes to start as many processes as possible until it has all the available processes are running, but some services actually may not be used during a typical session. One could argue that starting all available services and daemons at boot time is wasteful.

systemd

systemd was developed as an independent project, started by Lennart Poettering and Kay Sievers. It takes a different approach to parallelizing the boot process. It starts a process only if at least one other process requires it. Of course, to get the ball rolling, some processes must be required during the boot process (otherwise nothing ever would run).

This "lazy" approach means that rarely used services will not be started until the first time a process or user requests it. This is a leaner approach to Upstart, which does not differentiate between frequently used processes and rarely used ones. In light of these differences, it's not surprising that systemd starts Ubuntu slightly faster than Upstart.

Potential Glitches

Ubuntu is not the first distro to use systemd. Debian (Ubuntu's daddy) recently made the switch too. Other distros have experienced bugs as a result of the switch. For instance, service managers, which configure the boot config files, must be changed to work with the new init system.

Ubuntu cleverly sidestepped this problem by keeping its old init config file formats in place alongside the new format used by systemd. The version of systemd used in Ubuntu can read both. So old tools that work with the Upstart config settings still work.

systemd does provide a boost in boot performance over Upstart, but some members of the community are concerned that the way systemd handles messages to services will reduce performance and even open the door to denial-of-service attacks.

Clearly, Canonical must have a lot of faith in systemd to abandon Upstart (its own project) in its favor. As time passes, we will see whether this was a wise decision.

Load Disqus comments