In association with heise online

08 May 2012, 18:06

Control Centre: The systemd Linux init system

by Lennart Poettering, Kay Sievers, Thorsten Leemhuis

A variety of distributions now let systemd, rather than sysvinit, take care of bringing the system up. The newest of the three big init system promises to speed up booting and requires no explicit system service dependency configuration; as a side-effect, it also eliminates some distribution-specific peculiarities.

The following description of the ideas behind the systemd approach was first published in the German magazine c't 13/11 and has been updated in various places before appearing in The H Open.

In Linux distributions, the kernel traditionally passes on its system set-up responsibilities to the SysV-init component. For a few years, there was every indication that Upstart would replace the dated but still widely used init system. Two years ago, systemd set out to take on this difficult legacy. One of its particular characteristics is that it starts background services in parallel without requiring the dependencies between these services to be specified in advance; this uses hardware resources more efficiently and allows the system to start quickly.

Systemd also handles various tasks that were previously carried out using distribution-specific scripts; as a side effect, this eliminates various user interface and configuration differences between distributions. Several distributions already use systemd: Fedora (since version 15), openSUSE 12.1 and Mandriva 2011; Mageia will switch with version 2. Systemd is also included as an option in Arch Linux, Gentoo and Debian Testing; the developers of various other distributions are discussing whether to offer it as an option or switch altogether.

Tasks

Author's note

Co-authors Lennart Poettering and Kay Sievers designed and developed systemd. When the article text was written, Poettering worked for Red Hat and Sievers for Novell.

Since the early days of Unix, the init process has played a special role within the operating system because it is the first process to be generated by the kernel. All other processes are child processes of the init process, which, because of its special position, is responsible for configuring the userland. This includes implementing the filesystems that are required for system operation and configuring the network, as well as launching the services and programs that run in the background – including those that enable users to log into the system.

Once the system is configured, the init process remains in the background, mostly in an idle state. It communicates with the kernel and will be informed of events such as a user pressing Ctrl+Alt+Del. Just as when the users calls commands as shutdown -r now or reboot, the process number 1 will then initiate everything that's required to cleanly shut down the system.

In Unix System V in the 1980s, these tasks were handled by the simple but flexible "System V init system". In the 1990s, the developers created a new implementation of this init system and called it sysvinit. The new implementation operates with very similar logic and is still used in the majority of Linux distributions today. However, the increasing use of Linux on mobile devices, on desktop PCs, in TVs and in numerous other areas has changed the requirements for the init process.

Approaches

For a long time, it seemed that the Upstart system, a project which was started by a Canonical developer in 2006, would be the designated successor to the ageing sysvinit. Initially, it was only used in Ubuntu, but later it also became part of Fedora (versions 9 to 14) and Red Hat Enterprise Linux (RHEL6 family). OpenSUSE experimented with Upstart when developing version 11.3 but decided to stick with sysvinit back then. Upstart is an event-oriented init system – it can start services in case of events such as "network is configured" or "network device is mounted". Its approach differs greatly from that of SysV-init, and existing configurations can, therefore, only be migrated to Upstart's event-driven model with great difficulty, if at all.

Systemd was launched in April 2010; it adopts various ideas from previous init systems and combines them with a uniform configuration and administration interface. Systemd operates as a background service (daemon) and controls important system configuration tasks including hardware initialisation and the starting of server processes. The developers thought that its name is suitably reminiscent of the French term "système D", an expression that relates to "thinking on your feet" and describes high-speed technical problem-solving abilities such as those displayed by TV action hero MacGyver.

Next: Socket activation

  • Twitter
  • Facebook
  • submit to slashdot
  • StumbleUpon
  • submit to reddit
 


  • July's Community Calendar





The H Open

The H Security

The H Developer

The H Internet Toolkit