systemd is a software suite for system and service management on Linux built to unify service configuration and behavior across Linux distributions. Its main component is an init system used to bootstrap user space and manage user processes. It also provides various daemons and utilities, including device management, login management, network connection management, and event logging. The name systemd adheres to the Unix convention of naming daemons by appending the letter d, and also plays on the French phrase Système D (a person's ability to quickly adapt and improvise in the face of problems).
In Linux distributions, systemd is used as a replacement for Sysvinit and other init systems. Since 2015, nearly all Linux distributions have adopted systemd. It has been praised by developers and users of distributions that adopted it for providing a stable, fast out-of-the-box solution for issues that had existed in the Linux space for years. At the time of its adoption, it was the only parallel boot and init system offering centralized management of processes, daemons, services, and mount points.
Critics of systemd contend it suffers from feature creep and has damaged interoperability across Unix-like operating systems (as it does not run on non-Linux Unix derivatives like BSD or Solaris). In addition, they contend systemd's large feature set creates a larger attack surface. This has led to the development of several minor Linux distributions replacing systemd with other init systems like SysVinit or OpenRC.
History Lennart Poettering and Kay Sievers, the software engineers then working for Red Hat who initially developed systemd, started a project to replace Linux's conventional System V init in 2010. An April 2010 blog post from Poettering, titled "Rethinking PID 1", introduced an experimental version of what would later become systemd. They sought to surpass the efficiency of the init daemon in several ways. They wanted to improve the software framework for expressing dependencies, to allow more processes to run concurrently or in parallel during system booting, and to reduce the computational overhead of the shell.
In May 2011, Fedora Linux became the first major Linux distribution to enable systemd by default, replacing Upstart. The reasoning at the time was that systemd provided extensive parallelization during startup, better management of processes and overall a saner, dependency-based approach to control of the system.
In October 2012, Arch Linux made systemd the default, switching from SysVinit. Developers had debated since August 2012 and concluded it was faster and had more features than SysVinit and that maintaining SysVinit was not worth the effort. Some thought the criticism of systemd was not based on actual shortcomings of the software but rather personal dislike of Poettering and a general opposition to change. Several complaints about systemd—including its use of D-Bus, C instead of bash, and an optional on-disk journal format—were instead described as advantages by the Arch maintainers.
Between 2013 and 2014, the Debian Technical Committee engaged in a widely publicized debate on the mailing list about which init system to use as the default in Debian 8 before settling on systemd. Soon after, Debian developer Joey Hess, Technical Committee members Russ Allbery and Ian Jackson, and systemd package maintainer Tollef Fog Heen resigned from their positions, citing the extraordinary levels of stress caused by disputes on systemd integration within the Debian and FOSS community that rendered regular maintenance virtually impossible. Mark Shuttleworth announced soon afterwards that the Debian-based Ubuntu would use systemd to replace its old Upstart init system.
In August 2015, systemd started providing a login shell, callable via .
In September 2016, a security bug was discovered that allowed any unprivileged user to perform a denial-of-service attack against systemd. Rich Felker, developer of musl, stated that this bug reveals a major "system development design flaw". In 2017 another security bug was discovered in systemd-resolved, , which "allows disruption of service" by a "malicious DNS server". Later in 2017, the Pwnie Awards gave author Lennart Poettering a "lamest vendor response" award due to his handling of the vulnerabilities.
Design
Poettering describes systemd development as "never finished, never complete, but tracking progress of technology". In May 2014, Poettering further described systemd as unifying "pointless differences between distributions", by providing the following three general functions:
A system and service manager (manages both the system, by applying various configurations, and its services) A software platform (serves as a basis for developing other software) The glue between applications and the kernel (provides various interfaces that expose functionalities provided by the kernel)
includes features like on-demand starting of daemons, snapshot support, process tracking and Inhibitor Locks. It is not just the name of the init daemon but also refers to the entire software bundle around it, which, in addition to the init daemon, includes the daemons , and , and many other low-level components. In January 2013, Poettering described systemd not as one program, but rather a large software suite that includes 69 individual binaries. As an integrated software suite, systemd replaces the startup sequences and runlevels controlled by the traditional init daemon, along with the shell scripts executed under its control. systemd also integrates many other services that are common on Linux systems by handling user logins, the system console, device hotplugging (see udev), scheduled execution (replacing cron), logging, hostnames and locales.
Like the init daemon, is a daemon that manages other daemons, which, including itself, are background processes. is the first daemon to start during booting and the last daemon to terminate during shutdown. The daemon serves as the root of the user space's process tree; the first process (PID 1) has a special role on Unix systems, as it replaces the parent of a process when the original parent terminates. Therefore, the first process is particularly well suited for the purpose of monitoring daemons.
executes elements of its startup sequence in parallel, which is theoretically faster than the traditional startup sequence approach. For inter-process communication (IPC), makes Unix domain sockets and D-Bus available to the running daemons. The state of itself can also be preserved in a snapshot for future recall.
Core components and libraries Following its integrated approach, systemd also provides replacements for various daemons and utilities, including the startup shell scripts, pm-utils, inetd, , syslog, watchdog, cron and . systemd's core components include:
is a system and service manager for Linux operating systems. is a command to introspect and control the state of the systemd system and service manager. Not to be confused with sysctl. may be used to determine system boot-up performance statistics and retrieve other state and tracing information from the system and service manager.
tracks processes using the Linux kernel's cgroups subsystem instead of using process identifiers (PIDs); thus, daemons cannot "escape" , not even by double-forking. not only uses cgroups, but also augments them with and , two utility programs that facilitate the creation and management of Linux containers. Since version 205, systemd also offers ControlGroupInterface, which is an API to the Linux kernel cgroups. The Linux kernel cgroups are adapted to support kernfs, and are being modified to support a unified hierarchy.
Ancillary components Beside its primary purpose of providing a Linux init system, the systemd suite can provide additional functionality, including the following components:
is a daemon responsible for event logging, with append-only binary files serving as its logfiles. The system administrator may choose whether to log system events with , or .
is the standard library for utilizing udev, which allows third-party applications to query udev resources.
manages the system locale and keyboard layout.
is a daemon that manages user logins and seats in various ways. It is an integrated login manager that offers multiseat improvements and replaces ConsoleKit, which is no longer maintained. For X11 display managers the switch to requires a minimal amount of porting. It was integrated in systemd version 30.
manages the system hostname.
is a daemon that provides portable human-user accounts that are independent of current system configuration. moves various pieces of data such as UID/GID from various places across the filesystem into one file, . manages the user's home directory in various ways such as a plain directory, a btrfs subvolume, a Linux Unified Key Setup volume, an fscrypt directory, or mounted from an SMB server.
is a daemon to handle the configuration of the network interfaces; in version 209, when it was first integrated, support was limited to statically assigned addresses and basic support for bridging configuration. In July 2014, systemd version 215 was released, adding new features such as a DHCP server for IPv4 hosts, and VXLAN support. networkctl may be used to review the state of the network links as seen by systemd-networkd. Configuration of new interfaces has to be added under the /lib/systemd/network/ as a new file ending with .network extension. provides network name resolution to local applications
is a boot manager, formerly known as gummiboot. Kay Sievers merged it into systemd with rev 220.
is an error reporter used to generate Blue Screen of Death.
may be used to run a command or OS in a namespace container.
is a daemon that can be used to control time-related settings, such as the system time, system time zone, or selection between UTC and local time-zone system clock. It is accessible through D-Bus. It was integrated in systemd version 30. is a client NTP daemon for synchronizing the system clock across the network.
is a utility that takes care of creation and clean-up of temporary files and directories. It is normally run once at startup and then in specified intervals.
udev is a device manager for the Linux kernel, which handles the directory and all user space actions when adding/removing devices, including firmware loading. In April 2012, the source tree for udev was merged into the systemd source tree. In order to match the version number of udev, systemd maintainers bumped the version number directly from 44 to 183. On 29 May 2014, support for firmware loading through udev was dropped from systemd, as it was decided that the kernel should be responsible for loading firmware.
Configuration of systemd
is configured exclusively via plain-text files although GUI tools such as systemd-manager are also available.
records initialization instructions for each daemon in a configuration file (referred to as a "unit file") that uses a declarative language, replacing the traditionally used per-daemon startup shell scripts. The syntax of the language is inspired by files.
Unit-file types include:
(automatically initiated by systemd)
(which can be used as a cron-like job scheduler)
(used to group and manage processes and resources) (used to group worker processes, not intended to be configured via unit files)
Adoption