Systemd

From LQWiki
Jump to: navigation, search

Systemd is a Linux init system designed by Lennart Poettering and Kay Sievers as a replacement for the traditional Unix sysvinit. It was first used in Red Hat Linux but has gradually spread to other distributions, including Arch (an early adopter) and Debian.

Systemd was first conceived as a system daemon (hence the name) to babysit other daemons in the way that xinetd does specifically for Internet daemons. That is to say, it would hold open the sockets that daemons usually listen on and launch the appropriate daemon whenever a message was received at that socket, rather than starting all the daemons automatically at boot. It was then generalized to become an init system, since launching daemons is basically what init systems do. They also carry out one-off configuration jobs, but sysvinit uses the same kind of scripts to do this as it uses to launch daemons

The designers of systemd did not like the use of scripts because it is slow. Traditional Unix scripts launch numerous utility programs, which carry out one small job and then exit. This increases the kernel's workload. In systemd therefore, these scripts are replaced by a suite of configuration programs, each of which configures one aspect of userland. Most of the systemd programs come in pairs: the actual configuration program and a control interface program for the administrator: for example timed and timectl. Some of the interface programs have listing functions and these can be accessed by any user; those functions that alter the behavior of the configuration program require root access.

Systemd has proved very controversial. Many Linux users hate it, and it has led to some forking of distributions. For example Debian now has a non-systemd fork called Devuan. Particularly unpopular is the journald program, which creates a binary journal in place of the traditional plain text log files. journald allows you to display selective subsets of the journal, but it also makes it more difficult to troubleshoot a failed boot, as you need to use a rescue medium that can read the systemd journal format.

Those who are opposed to systemd argue that:

  1. Scripts are readable by eye and binary programs are not. Scripts can also be edited by administrators and programs cannot (except by changing the source code).
  2. A binary log file is especially unacceptable.
  3. Systemd is bloated compared with sysvinit.
  4. Systemd is invasive; more and more userland programs are becoming dependent on it.
  5. Systemd depends on dbus, which makes it less robust than an init system should be.
  6. Systemd is not the Unix way: Unix is supposed to be a toolkit, not a Swiss army knife.

Against this systemd advocates argue that:

  1. Current init scripts are too complicated to be edited by most administrators. Systemd can be configured by editing simple files in the Windows .ini format already used by freedesktop.org.
  2. Plain text log files are still available, since journald provides a socket where sysklogd can listen.
  3. The systemd package is a toolkit, not a program. The actual systemd program is not that large.
  4. Systemd has now absorbed the dbus library functions that it uses, so it no longer depends on dbus as such.
  5. The Unix way is out of date. Modern graphical programs like Firefox and Libreoffice are definitely Swiss army knives.