systemd

From Infogalactic: the planetary knowledge core
Jump to: navigation, search

<templatestyles src="Module:Hatnote/styles.css"></templatestyles>

systemd
260px
systemd startup on Debian GNU/Linux
Original author(s) Lennart Poettering, Kay Sievers, Harald Hoyer, Daniel Mack, Tom Gundersen and David Herrmann
Developer(s) Lennart Poettering, Kay Sievers, Harald Hoyer, Daniel Mack, Tom Gundersen, David Herrmann, and others[1]
Initial release 30 March 2010; 14 years ago (2010-03-30)
Stable release 221 (June 19, 2015; 8 years ago (2015-06-19)) [±][2]
Preview release 230 (May 21, 2016; 7 years ago (2016-05-21)) [±][3]
Written in C[4]
Operating system Linux
Type System software
License GNU LGPL 2.1+[5]
Website freedesktop.org/.../systemd/

systemd is an init system used by some Linux distributions to bootstrap the user space and manage all processes subsequently, instead of the UNIX System V or Berkeley Software Distribution (BSD) init systems. The name systemd adheres to the Unix convention of naming daemons by appending the letter d.[6] It is published as free and open-source software under the terms of the GNU Lesser General Public License (LGPL) version 2.1 or later.[5] One of systemd's main goals is to unify basic Linux configurations and service behaviors across all distributions.[7]

As of 2015, many Linux distributions have adopted systemd as their default init system.[8] The increasing adoption of systemd has been controversial, with critics arguing the software has violated the Unix philosophy by becoming increasingly complex, and that distributions have been forced to adopt it due to the dependency of various other software upon it, including, most notably, the GNOME 3 desktop environment.

Design

File:Systemd components.svg
The architecture of systemd as it is used by Tizen. Several components, including telephony, bootmode, dlog and tizen service, are from Tizen and are not components of systemd.[9]
File:Linux kernel unified hierarchy cgroups and systemd.svg
Unified-hierarchy cgroups will be accessible exclusively by systemd through systemd-nspawn[10]

Lennart Poettering and Kay Sievers, the software engineers working for Red Hat who initially developed systemd,[1] 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.

Poettering describes systemd development as "never finished, never complete, but tracking progress of technology". In May 2014, Poettering further defined systemd as aiming to unify "pointless differences between distributions", by providing the following three general functions:[11]

  • A system and service manager (manages both the system, as 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)

systemd 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.[12] 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 receives a SIGCHLD signal when a daemon process (which has detached from its parent) terminates. Therefore, the first process is particularly well suited for the purpose of monitoring daemons; systemd attempts to improve in that particular area over the traditional approach, which would usually not restart daemons automatically but only launch them once without further monitoring.

systemd executes elements of its startup sequence in parallel, which is faster than the traditional startup sequence's sequential approach.[13] 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.

Unit 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 include service, socket, device, mount, automount, swap, target, path, timer (which can be used as a cron-like job scheduler[14]), snapshot, slice and scope.[15]

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, acpid, syslog, watchdog, cron and atd. systemd's core components include the following:

  • systemd is a system and service manager for Linux operating systems.
  • systemctl may be used to introspect and control the state of the systemd system and service manager.
  • systemd-analyze may be used to determine system boot-up performance statistics and retrieve other state and tracing information from the system and service manager.

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 software containers.[16] Since version 205, systemd also offers ControlGroupInterface, which is an API to the Linux kernel cgroups.[17] The Linux kernel cgroups are adapted to support kernfs,[18] and are being modified to support a unified hierarchy.[19]

Ancillary components

Beside its primary purpose of providing a replacement Linux init system, systemd suite provides additional functionality, including its following components:

consoled
systemd-consoled provides a user console daemon, intending to replace the Linux kernel's virtual terminal support with a more capable userspace component.[20] Its preview version was released in October 2014, as part of systemd version 217.[21]
journald
systemd-journald 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 systemd-journald, syslog-ng or rsyslog. The corruption and obfuscation of the binary format has led to much heated debate.[22]
logind
systemd-logind is a daemon that manages user logins and seats in various ways. It is an integrated login manager that offers multiseat improvements[23] and replaces ConsoleKit, which is no longer maintained.[24] For X11 display managers the switch to logind requires a minimal amount of porting.[25] It was integrated in systemd version 30.
networkd
networkd 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.[26][27][28][29][30] In July 2014, systemd version 215 was released, adding new features such as a DHCP server for IPv4 hosts, and VXLAN support.[31][32]
timedated
systemd-timedated 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.[33] It was integrated in systemd version 30.
udevd
udev is a device manager for the Linux kernel, which handles the /dev 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.[34][35]
libudev
It is the standard library for utilizing udev, which allows third-party applications to query udev resources.
systemd-boot
systemd-boot is a boot manager, formerly known as gummiboot (software). Kai Sievers merged it into systemd with rev 220.

Graphical frontends

Screenshot of systemd-ui, a GTK+-based frontend for systemd.

A few graphical frontends are available, including:

systemd-ui
Also known as systemadm, it is a simple GTK+-based graphical front-end for systemd.[36] It provides a simple user interface to manage services and a graphical agent to request passwords from the user. As of 2014 the systemadm program has received little development or maintenance in the last few years, because development focus has shifted to command-line tools like systemctl and systemd-analyze.
systemd-kcm
Provides a graphical systemd frontend for the KDE Plasma 5 desktop. It integrates into the system settings window and allows monitoring and controlling of systemd units and logind sessions, as well as graphical editing of configuration files.[37]

Adoption and reception

While most 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 has been proposed to avoid systemd.[38]

systemd adoption of major Linux distributions
Linux distribution Date added to software repository[lower-alpha 1] Enabled by default? Can run without? Date released as default
Arch Linux January 2012[39] Yes Yes, but unsupported[40] October 2012[41]
CentOS April 2014 Yes Yes April 2014 (7.14.04)
CoreOS July 2013 Yes ? October 2013 (v94.0.0)[42][43]
Debian April 2012[44] Yes Yes April 2015 (v8)[45]
Fedora November 2010 (v14)[46] Yes No May 2011 (v15)
Gentoo Linux[lower-alpha 2] July 2011[47][49][50] No Yes N/A
Mageia January 2011 (v1.0)[51] Yes ? May 2012 (v2.0)[52]
openSUSE March 2011 (v11.4)[53] Yes No September 2012 (v12.2)[54]
Red Hat Enterprise Linux June 2014 (v7.0)[55] Yes No June 2014 (v7.0)
Slackware N/A (not in repository) N/A Yes N/A
SUSE Linux Enterprise Server October 2014 (v12) Yes No October 2014 (v12)
Ubuntu April 2013 (v13.04) Yes ? April 2015 (v15.04)

Integration with other software

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.[56]

In November 2012, the GNOME Project concluded that basic GNOME functionality should not rely on systemd.[57] 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 not actively maintained anymore and upstream recommends the use of systemd-logind instead.[58] 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.[59][60]

GNOME has further integrated logind.[61] As of Mutter version 3.13.2, logind is a dependency for Wayland sessions.[62] There are plans to replace gnome-session with systemd, but systemd would not be running as PID 1 and gnome-session would remain available on non-Linux systems. Since systemd supports only Linux and cannot be easily ported to other operating systems due to the heavy use of Linux kernel APIs, there is a need to offer compatible APIs on other operating systems such as OpenBSD.

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. In this he found similarities with the attitude he found in the GNOME project toward non-standard configurations.[63] On social media, Ts'o also later compared the attitudes of two key developers to that of GNOME's developers.[64]

History and controversy

Lua error in package.lua at line 80: module 'strict' not found.

The design of systemd has ignited controversy within the free software community. Critics argue that systemd is overly complex and suffers continued feature creep, and that its architecture violates the design principles of Unix-like operating systems. 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 come to depend on its components.[65]

In May 2011, Fedora became the first major Linux distribution to enable systemd by default.[66]

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.[67] As of August 2014, Slackware does not support or use systemd, but Volkerding has not ruled out the possibility of switching to it.[68]

In January 2013, Lennart Poettering attempted to address concerns about systemd in a blog post called The Biggest Myths.[12]

Between October 2013 and February 2014, a long debate among the Debian Technical Committee occurred on the Debian mailing list,[69] 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[70][71] 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 be following through as well in implementing systemd,[72] despite his earlier comments in October 2013 that described systemd as "hugely invasive and hardly justified".[73]

In March 2014, Eric S. Raymond opined that systemd's design goals were prone to mission creep and software bloat.[74] In April 2014, Linus Torvalds expressed reservations about the attitude of Kay Sievers, a key systemd developer, toward users and bug reports in regards to modifications sent to the linux kernel itself by Kay Sievers.[75] In late April 2014, a campaign to boycott systemd was launched, with a website listing various reasons against its adoption.[76][77]

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".[78] 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.[78]

In November 2014, Debian maintainers and Technical Committee members Joey Hess,[79] Russ Allbery,[80] Ian Jackson[81] and systemd package maintainer Tollef Fog Heen[82] 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 December 2014, a fork of Debian, called Devuan, was announced by a group calling themselves the "Veteran Unix Admins". Its intention is to provide a Debian variant without systemd installed by default.[83]

In August 2015, systemd now provides a login shell, callable via machinectl shell.[84]

In October 2015, an article titled "Structural and semantic deficiencies in the systemd architecture for real-world service management" was published, which criticized systemd in several areas, including its design as an object system with too many layers of indirection that make it prone to ordering-related failure cases, a difficult to predict execution model, its non-deterministic boot order, implicit state in unit file configurations and its general inadequacy at providing a uniform external abstraction for unit types.[85]

Opinions

<templatestyles src="Template:Blockquote/styles.css" />

systemd provides us with a great set of APIs to get done what we want to get done. In ‘earlier times’, we had to do these things for ourselves. Not so long ago, gnome-settings-daemon shipped some system-level services that were a poorly-written mess of #ifdef in order to do basic things like set the time and enable/disable NTP just so that we could provide a UI for this in gnome-control-center. We had to handle the cases for each operating system, for ourselves, often without having access to those systems for testing. These are components that run as root.

<templatestyles src="Template:Blockquote/styles.css" />

I understand the natural urge to design something newer than sysvinit, but how about testing it a bit more? I have 5 different computers, and on any given random reboot, 1 out of 5 of these won't boot. That's a 20% failure rate. Its been a 20% failure rate for over 6 years now. Exactly how much system testing is needed to push the failure rate to less than 1-out-of-5? Is it really that hard to test software before you ship it? Especially system software related to booting!? If systemd plans to take over the world, it should at least work, instead of failing.

<templatestyles src="Template:Blockquote/styles.css" />

I don't actually have any particularly strong opinions on systemd itself. I've had issues with some of the core developers that I think are much too cavalier about bugs and compatibility, and I think some of the design details are insane (I dislike the binary logs, for example), but those are details, not big issues."

— Linus Torvalds, to Steven J. Vaughan-Nichols, http://www.zdnet.com/article/lennart-poetterings-linus-torvalds-rant/

Forks and alternative implementations

eudev

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.[86] A stated goal of the project is to keep eudev independent of any Linux distribution or init system.[87]

elogind

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 in to 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.[88]

uselessd

In 2014, uselessd was created as a lightweight fork of systemd. The project seeks to remove features and programs deemed unnecessary for an init system, increase implementation modularity, improve portability across platforms, as well as address other perceived faults.[89]

uselessd supports the musl and µClibc libraries, so it may be used on embedded systems, whereas systemd only supports glibc. uselessd is attempting initial support for non-Linux platforms (so far only build time being ready), whereas the systemd project does not attempt any compatibility with BSD systems.[89] The uselessd project plans further improvements on cross-platform compatibility, as well as architectural overhauls and refactoring for the Linux build in the future.[90]

systembsd

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.[91]

The systembsd project will not provide an init replacement, but aims at providing OpenBSD with compatible daemons for hostnamed, timedated, localed, and logind in particular. The project does not create new systemd-like functionality, and is only meant to act as a wrapper over the native OpenBSD system. The developer aims 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."[91]

consolekit2

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.[92]

loginkit

LoginKit is an attempt to implement a logind (systemd-logind) shim, which allows packages that depend on it to work, without dependency on a specific init system.[93]

See also

Notes

  1. Dates are for the general availability release.
  2. systemd is supported in Gentoo as an alternative to OpenRC, the default init system[47] for those who "want to use systemd instead, or are planning to use Gnome 3.8 and later (which requires systemd)"[48]

References

  1. 1.0 1.1 Lua error in package.lua at line 80: module 'strict' not found.
  2. Lua error in package.lua at line 80: module 'strict' not found.
  3. Lua error in package.lua at line 80: module 'strict' not found.
  4. Lua error in package.lua at line 80: module 'strict' not found.
  5. 5.0 5.1 Lua error in package.lua at line 80: module 'strict' not found.
  6. Lua error in package.lua at line 80: module 'strict' not found.
  7. Lua error in package.lua at line 80: module 'strict' not found.
  8. Lua error in package.lua at line 80: module 'strict' not found.
  9. Lua error in package.lua at line 80: module 'strict' not found.
  10. Lua error in package.lua at line 80: module 'strict' not found.
  11. Lua error in package.lua at line 80: module 'strict' not found.
  12. 12.0 12.1 Lua error in package.lua at line 80: module 'strict' not found.
  13. Lua error in package.lua at line 80: module 'strict' not found.
  14. Lua error in package.lua at line 80: module 'strict' not found.
  15. Lua error in package.lua at line 80: module 'strict' not found.
  16. Lua error in package.lua at line 80: module 'strict' not found.
  17. Lua error in package.lua at line 80: module 'strict' not found.
  18. Lua error in package.lua at line 80: module 'strict' not found.
  19. Lua error in package.lua at line 80: module 'strict' not found.
  20. Lua error in package.lua at line 80: module 'strict' not found.
  21. Lua error in package.lua at line 80: module 'strict' not found.
  22. Lua error in package.lua at line 80: module 'strict' not found.
  23. Lua error in package.lua at line 80: module 'strict' not found.
  24. Lua error in package.lua at line 80: module 'strict' not found.
  25. Lua error in package.lua at line 80: module 'strict' not found.
  26. Lua error in package.lua at line 80: module 'strict' not found.
  27. Lua error in package.lua at line 80: module 'strict' not found.
  28. Lua error in package.lua at line 80: module 'strict' not found.
  29. Lua error in package.lua at line 80: module 'strict' not found.
  30. Lua error in package.lua at line 80: module 'strict' not found.
  31. Lua error in package.lua at line 80: module 'strict' not found.
  32. Lua error in package.lua at line 80: module 'strict' not found.
  33. Lua error in package.lua at line 80: module 'strict' not found.
  34. Lua error in package.lua at line 80: module 'strict' not found.
  35. Lua error in package.lua at line 80: module 'strict' not found.
  36. Lua error in package.lua at line 80: module 'strict' not found.
  37. Lua error in package.lua at line 80: module 'strict' not found.
  38. Lua error in package.lua at line 80: module 'strict' not found.
  39. Lua error in package.lua at line 80: module 'strict' not found.
  40. Lua error in package.lua at line 80: module 'strict' not found.
  41. Lua error in package.lua at line 80: module 'strict' not found.
  42. Lua error in package.lua at line 80: module 'strict' not found.
  43. Lua error in package.lua at line 80: module 'strict' not found.
  44. Lua error in package.lua at line 80: module 'strict' not found.
  45. Lua error in package.lua at line 80: module 'strict' not found.
  46. Lua error in package.lua at line 80: module 'strict' not found.
  47. 47.0 47.1 Lua error in package.lua at line 80: module 'strict' not found.
  48. Lua error in package.lua at line 80: module 'strict' not found.
  49. Lua error in package.lua at line 80: module 'strict' not found.
  50. Lua error in package.lua at line 80: module 'strict' not found.
  51. Lua error in package.lua at line 80: module 'strict' not found.
  52. Lua error in package.lua at line 80: module 'strict' not found.
  53. Lua error in package.lua at line 80: module 'strict' not found.
  54. Lua error in package.lua at line 80: module 'strict' not found.
  55. Lua error in package.lua at line 80: module 'strict' not found.
  56. Lua error in package.lua at line 80: module 'strict' not found.
  57. Lua error in package.lua at line 80: module 'strict' not found.
  58. Lua error in package.lua at line 80: module 'strict' not found.
  59. Lua error in package.lua at line 80: module 'strict' not found.
  60. Lua error in package.lua at line 80: module 'strict' not found.
  61. Lua error in package.lua at line 80: module 'strict' not found.
  62. Lua error in package.lua at line 80: module 'strict' not found.
  63. Lua error in package.lua at line 80: module 'strict' not found.
  64. Lua error in package.lua at line 80: module 'strict' not found.
  65. Lua error in package.lua at line 80: module 'strict' not found.
  66. Lua error in package.lua at line 80: module 'strict' not found.
  67. Lua error in package.lua at line 80: module 'strict' not found.
  68. Lua error in package.lua at line 80: module 'strict' not found.
  69. Lua error in package.lua at line 80: module 'strict' not found.
  70. Lua error in package.lua at line 80: module 'strict' not found.
  71. Lua error in package.lua at line 80: module 'strict' not found.
  72. Lua error in package.lua at line 80: module 'strict' not found.
  73. Lua error in package.lua at line 80: module 'strict' not found.
  74. Lua error in package.lua at line 80: module 'strict' not found.
  75. Lua error in package.lua at line 80: module 'strict' not found.
  76. Lua error in package.lua at line 80: module 'strict' not found.
  77. Lua error in package.lua at line 80: module 'strict' not found.
  78. 78.0 78.1 Lua error in package.lua at line 80: module 'strict' not found.
  79. Lua error in package.lua at line 80: module 'strict' not found.
  80. Lua error in package.lua at line 80: module 'strict' not found.
  81. Lua error in package.lua at line 80: module 'strict' not found.
  82. Lua error in package.lua at line 80: module 'strict' not found.
  83. Lua error in package.lua at line 80: module 'strict' not found.
  84. Lua error in package.lua at line 80: module 'strict' not found.
  85. Lua error in package.lua at line 80: module 'strict' not found.
  86. Lua error in package.lua at line 80: module 'strict' not found.
  87. Lua error in package.lua at line 80: module 'strict' not found.
  88. Lua error in package.lua at line 80: module 'strict' not found.
  89. 89.0 89.1 Lua error in package.lua at line 80: module 'strict' not found.
  90. Lua error in package.lua at line 80: module 'strict' not found.
  91. 91.0 91.1 Lua error in package.lua at line 80: module 'strict' not found.
  92. Lua error in package.lua at line 80: module 'strict' not found.
  93. Lua error in package.lua at line 80: module 'strict' not found.

External links