systemd is an init system used in Linux distributions to bootstrap the user space. Subsequently to booting, it is used to manage system processes. It is a replacement for the UNIX System V and Berkeley Software Distribution (BSD) init systems. The goal is unification of basic Linux configurations and service behaviors across all distributions.
As of 2015, a large number of Linux distributions have followed their parent Linux-distributions (such as Red Hat) in adopting systemd as their default init system. The increasing adoption of systemd has been controversial, with critics arguing that 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 GNOME 3, a desktop environment.
The name systemd adheres to the Unix convention of naming daemons by appending the letter d. It also plays on the term "System D", which refers to a person's ability to adapt quickly and improvise to solve problems.
Video Systemd
Design
Lennart Poettering and Kay Sievers, the software engineers working for Red Hat who initially developed systemd, 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:
- 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. 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. 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), snapshot, slice and scope.
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 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 replacement Linux init system, systemd suite provides additional functionality, including its following components:
- 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 potential for corruption of the binary format has led to much heated debate.
- 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 and replaces ConsoleKit, which is no longer maintained. For X11 display managers the switch to logind requires a minimal amount of porting. 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. In July 2014, systemd version 215 was released, adding new features such as a DHCP server for IPv4 hosts, and VXLAN support.
- tmpfiles
- systemd-tmpfiles 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.
- 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. 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.
- 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. Kay Sievers merged it into systemd with rev 220.
Maps Systemd
Graphical frontends
A few graphical frontends are available, including:
- systemd-ui
- Also known as systemadm, it is a simple GTK+-based graphical front-end for systemd. 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. Systemd-kcm was renamed to SystemdGenie and is now a standalone application.
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 called Devuan is in development to avoid systemd.
Availability
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.
Criticism
The design of systemd has ignited controversy within the free-software community. Critics regard systemd as overly complex and suffering from continued feature creep; they claim 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.
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.
In November 2012, the GNOME Project concluded that basic GNOME functionality should not rely on systemd. 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. 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.
GNOME has further integrated logind. As of Mutter version 3.13.2, logind is a dependency for Wayland sessions. 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. On social media, Ts'o also later compared the attitudes of two key developers to that of GNOME's developers.
History
Lennart Poettering and Kay Sievers started the project to develop systemd in 2010.
In May 2011 Fedora became the first major Linux distribution to enable systemd by default.
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. As of August 2014, Slackware does not support or use systemd, but Volkerding has not ruled out the possibility of switching to it.
In January 2013, Lennart Poettering attempted to address concerns about systemd in a blog post called The Biggest Myths.
Between October 2013 and February 2014, a long debate among the Debian Technical Committee occurred on the Debian mailing list, 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 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, despite his earlier comments in October 2013 that described systemd as "hugely invasive and hardly justified".
In March 2014 Eric S. Raymond opined that systemd's design goals were prone to mission creep and software bloat. 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 sent by Sievers to the Linux kernel itself. In late April 2014 a campaign to boycott systemd was launched, with a website listing various reasons against its adoption.
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". 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.
In November 2014 Debian maintainers and Technical Committee members Joey Hess, Russ Allbery, Ian Jackson and systemd package-maintainer Tollef Fog Heen 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 group calling themselves the "Veteran Unix Admins" announced a fork of Debian called Devuan. It intends to provide a Debian variant without systemd installed by default.. Devuan 1.0.0 was released on May 26, 2017.
In August 2015 systemd started providing a login shell, callable via machinectl shell.
In September 2016, a 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."
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. A stated goal of the project is to keep eudev independent of any Linux distribution or init system.
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 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.
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.
uselessd supports the musl and µClibc libraries, so it may be used on embedded systems, whereas systemd only supports glibc. uselessd was 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. 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. Project development halted in January of 2015.
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.
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."
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.
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.
notsystemd
Notsystemd intends to implement all Systemd's features working on any init system. It was forked by the Parabola GNU/Linux-libre hackers to build packages with their development tools without the necessity of having Systemd installed to run systemd-nspawn.
See also
- Upstart
- BusyBox
- init
- launchd
- readahead
- Operating system service management
- Devuan
- Category:Linux distributions without systemd
Notes
References
External links
- Official website
- Systemd on GitHub
- Rethinking PID 1
- The road forward for systemd on LWN.net
- Init systems comparison: part 1 and part 2 on LWN.net
Source of article : Wikipedia