Friday, August 28, 2015

about systemd

systemd is a suite of system management daemons, libraries, and utilities designed as a central management and
configuration platform for the Linux computer operating system. Described by its authors as a "basic building block" for an operating system,systemd can be used as a Linux init system (the process called by the Linux kernel to initialize the user space during the Linux startup process and manage all processes afterwards) replacing the UNIX System V and Berkeley Software Distribution (BSD) style daemon. The name systemd adheres to the Unix convention of making daemons easier to distinguish by having the letter d as the last letter of the file name.
systemd is designed for Linux and programmed exclusively for the Linux API. 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. One of systemd's main goals is to unify basic Linux configurations and service behaviors across all distributions.
The design of systemd generated significant controversy within the free software community. Critics argue that systemd's architecture violates the Unix philosophy and that it will eventually form a system of interlocking dependencies. However, as of 2015 most major Linux distributions have adopted it as their default init system.

Design

Lennart Poettering and Kay Sievers, software engineers 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 journaldlogind 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 systemditself, 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 makesUnix 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 servicesocketdevicemountautomountswaptargetpathtimer (which can be used as a cron-like job scheduler), snapshotslice 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 by 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. 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:
consoled
systemd-consoled provides a user console daemon, intending to replace the Linux kernel's virtual terminal support with a more capable userspace component. Its preview version was released in October 2014, as part of systemd version 217.
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-journaldsyslog-ng or rsyslog.
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 replacesConsoleKit, 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.
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.

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 factodependency of GNOME for most Linux distributions, in particular since ConsoleKit is not actively maintained anymore and upstream recommends the use of systemd-logindinstead. 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, 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.

Graphical frontends

A few graphical frontends are available, including the following:
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 andsystemd-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.

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.
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 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. The uselessd project plans further improvements on cross-platform compatibility, as well as architectural overhauls and refactoring for the Linux build in the future.
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 hostnamedtimedatedlocaled, 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.

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.
systemd adoption of major Linux distributions
Linux distributionDate added to software repositoryEnabled by default?Date released as default
Arch LinuxJanuary 2012YesOctober 2012
CoreOSJuly 2013YesOctober 2013 (v94.0.0)
DebianApril 2012YesApril 2015 (v8 aka jessie)
FedoraNovember 2010 (v14)YesMay 2011 (v15)
Gentoo LinuxJuly 2011NoN/A
MageiaMay 2012 (v2.0)YesMay 2012 (v2.0)
openSUSEMarch 2011 (v11.4)YesSeptember 2012 (v12.2)
Red Hat Enterprise LinuxJune 2014 (v7.0)YesJune 2014 (v7.0)
SlackwareN/A (not in repository)N/AN/A
SUSE Linux Enterprise ServerOctober 2014 (v12)YesOctober 2014 (v12)
UbuntuApril 2013 (v13.04)YesApril 2015 (v15.04)

History and controversy

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.
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 January 2013, Lennart Poettering attempted to address concerns about systemd in a blog post called The Biggest Myths. After continued controversy over systemd, in October 2014, Poettering complained that the "Open Source community is full of assholes, and I probably more than most others am one of their most favourite targets." Poettering went on to blame Linus Torvalds and other kernel developers for the state of the community.
In February 2014, after the Debian's decision was made, Mark Shuttleworth announced on his blog that Ubuntu would be following through as well 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 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 three 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.

No comments: