systemd startup on Fedora 17 | |
| Original author(s) | Lennart Poettering[1] |
|---|---|
| Developer(s) | Red Hat (Lennart Poettering, Kay Sievers, Harald Hoyer, Daniel Mack, Tom Gundersen, David Herrmann)[2] 345 different authors at 2018 and 1,317 different authors in total[3] |
| Initial release | 30 March 2010; 10 years ago |
| Stable release | 245 (March 6, 2020; 2 months ago) [±][4] |
| Repository | |
| Written in | C |
| Operating system | Linux |
| Type | System software Process supervisor |
| License | LGPLv2.1+[5] |
| Website | systemd.io |
systemd is a software suite that provides an array of system components for Linux operating systems.
Its main aim is to unify service configuration and behavior across Linux distributions;[6] systemd's primary component is a "system and service manager"—an init system used to bootstrap user space and manage user processes. It also provides replacements for 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.[7] It also plays on the term "System D", which refers to a person's ability to adapt quickly and improvise to solve problems.[8]
Since 2015, the majority of Linux distributions have adopted systemd, having replaced other systems such as the UNIX System V and BSD init systems. systemd has faced mixed reception from Linux users, with arguments that systemd suffers from mission creep and bloat, as well as criticism over software (such as the GNOME desktop) adding dependencies on systemd—frustrating compatibility with other Unix-like operating systems.[9][1]
Lennart Poettering and Kay Sievers, the software engineers working for Red Hat who initially developed systemd,[2] started the project to develop systemd in 2010.[10] 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 processing to be done concurrently or in parallel during system booting, and to reduce the computational overhead of the shell.
In May 2011 Fedora became the first major Linux distribution to enable systemd by default.[11] Between October 2013 and February 2014, a long debate among the Debian Technical Committee occurred on the Debian mailing list,[12] discussing which init system to use as the default in Debian 8 "jessie", and culminating in a decision in favor of systemd. The debate was widely publicized[13][14] and in the wake of the decision the debate continues on the Debian mailing list. In February 2014, after Debian's decision was made, Mark Shuttleworth announced on his blog that Ubuntu would follow in implementing systemd.[15][16]
In November 2014 Debian Developer Joey Hess,[17] Debian Technical Committee members Russ Allbery[18] and Ian Jackson,[19] and systemd package-maintainer Tollef Fog Heen[20] resigned from their positions. All four justified their decision on the public Debian mailing list and in personal blogs with their exposure to extraordinary stress-levels related to ongoing disputes on systemd integration within the Debian and open-source community that rendered regular maintenance virtually impossible.
In August 2015 systemd started providing a login shell, callable via machinectl shell.[21]
In September 2016, a security bug was discovered that allowed any unprivileged user to perform a denial-of-service attack against systemd.[22] Rich Felker, developer of musl, stated that this bug reveals a major "system development design flaw".[23] In 2017 another security bug was discovered in systemd, CVE-2017-9445, which "allows disruption of service" by a "malicious DNS server".[24][25]
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:[28]
Systemd includes features like on-demand starting of daemons, snapshot support, process tracking[29] and Inhibitor Locks.[30] 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 systemd init daemon, includes the daemons journald, logind and networkd, 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.[31] 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, systemd is a daemon that manages other daemons, which, including systemd itself, are background processes. systemd is the first daemon to start during booting and the last daemon to terminate during shutdown. The systemd 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.
systemd executes elements of its startup sequence in parallel, which is theoretically faster than the traditional startup sequence approach.[32] For inter-process communication (IPC), systemd makes Unix domain sockets and D-Bus available to the running daemons. The state of systemd itself can also be preserved in a snapshot for future recall.
Following its integrated approach, systemd also provides replacements for various daemons and utilities, including the startup shell scripts, pm-utils, inetd, acpid, syslog, watchdog, cron and atd. systemd's core components include the following:
systemd tracks processes using the Linux kernel's cgroups subsystem instead of using process identifiers (PIDs); thus, daemons cannot "escape" systemd, not even by double-forking. systemd not only uses cgroups, but also augments them with systemd-nspawn and machinectl, two utility programs that facilitate the creation and management of Linux containers.[33] Since version 205, systemd also offers ControlGroupInterface, which is an API to the Linux kernel cgroups.[34] The Linux kernel cgroups are adapted to support kernfs,[35] and are being modified to support a unified hierarchy.[36]
Beside its primary purpose of providing a Linux init system, the systemd suite can provide additional functionality, including the following components:
networkctl may be used to review the state of the network links as seen by systemd-networkd.[48] Configuration of new interfaces has to be added under the /lib/systemd/network/ as a new file ending with .network extension.systemd is configured exclusively via plain-text files.
systemd 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. Unit-file types[53] include:
man systemd.unit explains the hierarchy of the configuration files. Their paths are defined during compilation. The default:
UNIT LOAD PATH
Unit files are loaded from a set of paths determined during
compilation, described in the two tables below. Unit files found
in directories listed earlier override files with the same name
in directories lower in the list.
Table 1. Load path when running in system mode (--system).
┌────────────────────────┬─────────────────────────────┐
│Path │ Description │
├────────────────────────┼─────────────────────────────┤
│/etc/systemd/system │ Local configuration │
├────────────────────────┼─────────────────────────────┤
│/run/systemd/system │ Runtime units │
├────────────────────────┼─────────────────────────────┤
│/usr/lib/systemd/system │ Units of installed packages │
└────────────────────────┴─────────────────────────────┘
| Linux distribution | Date added to software repository[a] | Enabled by default? | Date released as default | Runs without? |
|---|---|---|---|---|
| Alpine Linux | N/A (not in repository) | No | N/A | Yes |
| Android | N/A (not in repository) | No | N/A | Yes |
| Arch Linux | January 2012[56] | Yes | October 2012[57] | No |
| AntiX Linux | N/A (not in repository) | No | N/A | Yes |
| Artix Linux | N/A (not in repository) | No | N/A | Yes |
| CentOS | April 2014 | Yes | April 2014 (7.14.04) | No |
| CoreOS | July 2013 | Yes | October 2013 (v94.0.0)[58][59] | No |
| Debian | April 2012[60] | Yes | April 2015 (v8)[61] | Yes[62] |
| Devuan | N/A (not in repository) | No | N/A | Yes |
| Fedora | November 2010 (v14)[63] | Yes | May 2011 (v15) | No |
| Gentoo Linux[b] | July 2011[64][66][67] | No | N/A | Yes |
| Knoppix | N/A | No [68][69] | N/A | Yes |
| Linux Mint | June 2016 (v18.0) | Yes | N/A | Yes |
| Mageia | January 2011 (v1.0)[70] | Yes | May 2012 (v2.0)[71] | No [72] |
| Manjaro Linux | Nov 2013 | Yes | Nov 2013 | No |
| openSUSE | March 2011 (v11.4)[73] | Yes | September 2012 (v12.2)[74] | No |
| Parabola GNU/Linux-libre | January 2012[56] | Optional[75] | N/A | Yes |
| Red Hat Enterprise Linux | June 2014 (v7.0)[76] | Yes | June 2014 (v7.0) | No |
| Slackware | N/A (not in repository) | No | N/A | Yes |
| Solus | N/A | Yes | N/A | No |
| Source Mage GNU/Linux | June 2011[77] | No | N/A | Yes |
| SUSE Linux Enterprise Server | October 2014 (v12) | Yes | October 2014 (v12) | No |
| Ubuntu | April 2013 (v13.04) | Yes | April 2015 (v15.04) | Upstart option removed in Yaketty (16.04)[78][79] Missing functionality using init systems other than systemd[citation needed] |
| Void Linux | June 2011, removed June 2015 [80] | No | N/A | Yes |
While many distributions boot systemd by default, some allow other init systems to be used; in this case switching the init system is possible by installing the appropriate packages. A fork of Debian called Devuan was developed to avoid systemd and has reached version 2.0 for stable usage.[81][82] In December 2019, the Debian project voted in favour of retaining systemd as the default init system for the distribution, but with support for "exploring alternatives".[83]
In the interest of enhancing the interoperability between systemd and the GNOME desktop environment, systemd coauthor Lennart Poettering asked the GNOME Project to consider making systemd an external dependency of GNOME 3.2.[84]
In November 2012, the GNOME Project concluded that basic GNOME functionality should not rely on systemd.[85] However, GNOME 3.8 introduced a compile-time choice between the logind and ConsoleKit API, the former being provided at the time only by systemd. Ubuntu provided a separate logind binary but systemd became a de facto dependency of GNOME for most Linux distributions, in particular since ConsoleKit is no longer actively maintained and upstream recommends the use of systemd-logind instead.[86] The developers of Gentoo Linux also attempted to adapt these changes in OpenRC, but the implementation contained too many bugs, causing the distribution to mark systemd as a dependency of GNOME.[87][88]
GNOME has further integrated logind.[89] As of Mutter version 3.13.2, logind is a dependency for Wayland sessions.[90]
The design of systemd has ignited controversy within the free-software community. Critics regard systemd as overly complex and suffering from continued feature creep, arguing that its architecture violates the Unix philosophy. There is also concern that it forms a system of interlocked dependencies, thereby giving distribution maintainers little choice but to adopt systemd as more user-space software comes to depend on its components.[91]
In a 2012 interview, Slackware's lead Patrick Volkerding expressed reservations about the systemd architecture, stating his belief that its design was contrary to the Unix philosophy of interconnected utilities with narrowly defined functionalities.[92] As of August 2018, Slackware does not support or use systemd, but Volkerding has not ruled out the possibility of switching to it.[93]
In January 2013, Lennart Poettering attempted to address concerns about systemd in a blog post called The Biggest Myths.[31]
In February 2014, musls Rich Felker opined that PID 1 is too special, should be 10 lines of code and not require reboot on upgrade. PID 1 should only start the real init script, and reap zombie processes. All the functionality of systemd then can be provided by the init script and programs run from it. PID 1 so has only a small attack surface, and user level programs can evolve diversly.[94]
In March 2014 Eric S. Raymond opined that systemd's design goals were prone to mission creep and software bloat.[95] In April 2014, Linus Torvalds expressed reservations about the attitude of Kay Sievers, a key systemd developer, toward users and bug reports in regard to modifications to the Linux kernel submitted by Sievers.[96] In late April 2014 a campaign to boycott systemd was launched, with a Web site listing various reasons against its adoption.[97][98]
In an August 2014 article published in InfoWorld, Paul Venezia wrote about the systemd controversy and attributed the controversy to violation of the Unix philosophy, and to "enormous egos who firmly believe they can do no wrong".[99] The article also characterizes the architecture of systemd as similar to that of svchost.exe, a critical system component in Microsoft Windows with a broad functional scope.[99]
In a September 2014 ZDNet interview, prominent Linux kernel developer Theodore Ts'o expressed his opinion that the dispute over systemd's centralized design philosophy, more than technical concerns, indicates a dangerous general trend toward uniformizing the Linux ecosystem, alienating and marginalizing parts of the open-source community, and leaving little room for alternative projects. He cited similarities with the attitude he found in the GNOME project toward non-standard configurations.[100] On social media, Ts'o also later compared the attitudes of Sievers and his co-developer, Lennart Poettering, to that of GNOME's developers.[101]
On 6 July 2015, an issue was raised on the systemd GitHub page expressing concerns about the hard coding of DNS servers in the systemd code. Poettering responded that it is not the actual DNS but rather the fallback DNS that is hard coded. He added that the fallback DNS is only used if "nobody configured anything" and to prevent connectivity issues due to catastrophic failure of configuration files or a lack of DHCP on the network. As Poettering described, the system "should do the right thing" if, as an example, the /etc directory were missing or empty. Poettering also noted that the /etc/systemd/resolved.conf file installed with systemd contains exactly the same DNS servers as the fallback DNS, thereby resulting in the same operation regardless of the /etc directory being empty or present.[102]
In 2012, the Gentoo Linux project created a fork of udev in order to avoid dependency on the systemd architecture. The resulting fork is called eudev and it makes udev functionality available without systemd.[103] A stated goal of the project is to keep eudev independent of any Linux distribution or init system.[104]
Elogind is the systemd project's "logind", extracted out to be a standalone daemon. It integrates with PAM to know the set of users that are logged into a system and whether they are logged in graphically, on the console, or remotely. Elogind exposes this information via the standard org.freedesktop.login1 D-Bus interface, as well as through the file system using systemd's standard /run/systemd layout. Elogind also provides "libelogind", which is a subset of the facilities offered by "libsystemd". There is a "libelogind.pc" pkg-config file as well.[105]
In 2014, uselessd was created as a lightweight fork of systemd. The project sought to remove features and programs deemed unnecessary for an init system, as well as address other perceived faults.[106] Project development halted in January 2015.[107]
uselessd supported the musl and µClibc libraries, so it may have been used on embedded systems, whereas systemd only supports glibc. The uselessd project had planned further improvements on cross-platform compatibility, as well as architectural overhauls and refactoring for the Linux build in the future.[108]
In 2014, a Google Summer of Code project named "systembsd" was started in order to provide alternative implementations of these APIs for OpenBSD. The original project developer began it in order to ease his transition from Linux to OpenBSD.[109] Project development halted in July 2016.[110]
The systembsd project did not provide an init replacement, but aimed to provide OpenBSD with compatible daemons for hostnamed, timedated, localed, and logind. The project did not create new systemd-like functionality, and was only meant to act as a wrapper over the native OpenBSD system. The developer aimed for systembsd to be installable as part of the ports collection, not as part of a base system, stating that, "systemd and *BSD differ fundamentally in terms of philosophy and development practices."[109]
ConsoleKit was forked in October 2014 by Xfce developers wanting its features to still be maintained and available on operating systems other than Linux. While not ruling out the possibility of reviving the original repository in the long term, the main developer considers ConsoleKit2 a temporary necessity until systembsd matures.[111]
Development ceased in December 2017 and the project may be defunct.[112]
LoginKit was an attempt to implement a logind (systemd-logind) shim, which would allow packages that depend on systemd-logind to work without dependency on a specific init system.[113]
The project has been defunct since February 2015.[114]
Notsystemd intends to implement all systemd's features working on any init system.[115] It was forked by the Parabola GNU/Linux-libre developers to build packages with their development tools without the necessity of having systemd installed to run systemd-nspawn.
Yes, it is written systemd, not system D or System D, or even SystemD. And it isn't system d either. Why? Because it's a system daemon, and under Unix/Linux those are in lower case, and get suffixed with a lower case d.
systemd defines itself as a system and service manager. The project was initiated in 2010 by Lennart Poettering and Kay Sievers to create an integrated set of tools for managing a Linux system including an init daemon.
It certainly is not something that comes with systemd from upstream.
networkctl(1) – Linux User's Manual – User Commands
[...] a slice [...] is a concept for hierarchically managing resources of a group of processes.
...script-based KNOPPIX system start with sysvinit
...Knoppix 'boot process continues to run via Sys-V init with few bash scripts that start the system services efficiently sequentially or in parallel. (The original German text: Knoppix' Startvorgang läuft nach wie vor per Sys-V-Init mit wenigen Bash-Skripten, welche die Systemdienste effizient sequenziell oder parallel starten.)
The recently released openSUSE 12.2 does migrate from SysVinit to systemd
ConsoleKit is currently not actively maintained. The focus has shifted to the built-in seat/user/session management of Software/systemd called systemd-logind!