6.54. Systemd-237

The systemd package contains programs for controlling the startup, running, and shutdown of the system.

Approximate build time: 1.1 SBU
Required disk space: 297 MB

6.54.1. Installation of systemd

Create a symlink to work around missing xsltproc:

ln -sf /tools/bin/true /usr/bin/xsltproc

Set up the man pages:

tar -xf ../systemd-man-pages-237.tar.xz

Remove tests that cannot be built in chroot:

sed '178,222d' -i src/resolve/meson.build

Remove an unneeded group, render, from the default udev rules:

sed -i 's/GROUP="render", //' rules/50-udev-default.rules.in

Prepare systemd for compilation:

mkdir -p build
cd       build

LANG=en_US.UTF-8                   \
meson --prefix=/usr                \
      --sysconfdir=/etc            \
      --localstatedir=/var         \
      -Dblkid=true                 \
      -Dbuildtype=release          \
      -Ddefault-dnssec=no          \
      -Dfirstboot=false            \
      -Dinstall-tests=false        \
      -Dkill-path=/bin/kill        \
      -Dkmod-path=/bin/kmod        \
      -Dldconfig=false             \
      -Dmount-path=/bin/mount      \
      -Drootprefix=                \
      -Drootlibdir=/lib            \
      -Dsplit-usr=true             \
      -Dsulogin-path=/sbin/sulogin \
      -Dsysusers=false             \
      -Dumount-path=/bin/umount    \
      -Db_lto=false                \

The meaning of the meson options:


These switches provide location of binaries needed by systemd at runtime that have not yet been installed, or who's pkgconfig files are currently only in /tools/lib/pkgconfig.


This switch turns off the experimental DNSSEC support.


This switch prevents installation of systemd services responsible for setting up the system for the first time. They are not useful for LFS because everything is done manually.


This switch prevents installation of the compiled tests.


This switch prevents installation of a systemd unit that runs ldconfig at boot, which is not useful for source distributions such as LFS and makes the boot time longer. Remove it if the described feature is desired.


These switches ensure that core programs and shared libraries are installed in the subdirectories of the root partition.


This switch ensures that systemd will work on systems where /bin, /lib and /sbin directories are not symlinks to their /usr counterparts.


This switch prevents installation of systemd services responsible for setting up the /etc/group and /etc/passwd files. Both files were created earlier in this chapter.

Compile the package:

LANG=en_US.UTF-8 ninja

Install the package:

LANG=en_US.UTF-8 ninja install

Remove an unnecessary directory:

rm -rfv /usr/lib/rpm

Create the Sysvinit compatibility symlinks, so systemd is used as the default init system:

for tool in runlevel reboot shutdown poweroff halt telinit; do
     ln -sfv ../bin/systemctl /sbin/${tool}
ln -sfv ../lib/systemd/systemd /sbin/init

Remove our earlier created symlink for xsltproc:

rm -f /usr/bin/xsltproc

Create the /etc/machine-id file needed by systemd-journald:


Create the /lib/systemd/systemd-user-sessions script to allow unprivileged user logins without systemd-logind:

cat > /lib/systemd/systemd-user-sessions << "EOF"
rm -f /run/nologin
chmod 755 /lib/systemd/systemd-user-sessions

6.54.2. Contents of systemd

Installed programs: bootctl, busctl, coredumpctl, halt, hostnamectl, init, journalctl, kernel-install, localectl, loginctl, machinectl, networkctl, poweroff, reboot, runlevel, shutdown, systemctl, systemd-analyze, systemd-ask-password, systemd-cat, systemd-cgls, systemd-cgtop, systemd-delta, systemd-detect-virt, systemd-escape, systemd-hwdb, systemd-inhibit, systemd-machine-id-setup, systemd-mount, systemd-notify, systemd-nspawn, systemd-path, systemd-resolve, systemd-run, systemd-socket-activate, systemd-stdio-bridge, systemd-tmpfiles, systemd-tty-ask-password-agent, telinit, timedatectl, and udevadm
Installed libraries: libnss_myhostname.so.2, libnss_mymachines.so.2, libnss_resolve.so.2, libnss_systemd.so.2, libsystemd.so, libsystemd-shared-231.so, and libudev.so
Installed directories: /etc/binfmt.d, /etc/init.d, /etc/kernel, /etc/modules-load.d, /etc/sysctl.d, /etc/systemd, /etc/tmpfiles.d, /etc/udev, /etc/xdg/systemd, /lib/systemd, /lib/udev, /usr/include/systemd, /usr/lib/binfmt.d, /usr/lib/kernel, /usr/lib/modules-load.d, /usr/lib/sysctl.d, /usr/lib/systemd, /usr/lib/tmpfiles.d, /usr/share/doc/systemd-237, /usr/share/factory, /usr/share/systemd, /var/lib/systemd, and /var/log/journal

Short Descriptions


Used to query the firmware and boot manager settings


Used to introspect and monitor the D-Bus bus


Used to retrieve coredumps from the systemd Journal


Normally invokes shutdown with the -h option, except when already in run-level 0, then it tells the kernel to halt the system; it notes in the file /var/log/wtmp that the system is being brought down


Used to query and change the system hostname and related settings


The first process to be started when the kernel has initialized the hardware which takes over the boot process and starts all processes according to its configuration files


Used to query the contents of the systemd journal


Used to add and remove kernel and initramfs images to and from /boot


Used to query and change the system locale and keyboard layout settings


Used to introspect and control the state of the systemd Login Manager


Used to introspect and control the state of the systemd Virtual Machine and Container Registration Manager


Used to introspect the state of the network links as seen by systemd-networkd


Tells the kernel to halt the system and switch off the computer (see halt)


Tells the kernel to reboot the system (see halt)


Reports the previous and the current run-level, as noted in the last run-level record in /var/run/utmp


Brings the system down in a secure way, signaling all processes and notifying all logged-in users


Used to introspect and control the state of the systemd system and service manager


Used to determine system boot-up performance of the current boot


Used to query a system password or passphrase from the user, using a question message specified on the command line


Used to connect STDOUT and STDERR of a process with the Journal


Recursively shows the contents of the selected Linux control group hierarchy in a tree


Shows the top control groups of the local Linux control group hierarchy, ordered by their CPU, memory and disk I/O load


Used to identify and compare configuration files in /etc that override default counterparts in /usr


Detects execution in a virtualized environment


Used to escape strings for inclusion in systemd unit names


Used to manage hardware database (hwdb)


Used to execute a program with a shutdown, sleep or idle inhibitor lock taken


Used by system installer tools to initialize the machine ID stored in /etc/machine-id at install time with a randomly generated ID


A tool to temporarily mount or auto-mount a drive.


Used by daemon scripts to notify the init system about status changes


Used to run a command or OS in a light-weight namespace container


Used to query system and user paths


Used to resolve domain names, IPV4 and IPv6 addresses, DNS resource records, and services


Used to create and start a transient .service or a .scope unit and run the specified command in it


A tool to listen on socket devices and launch a process upon connection.


Creates, deletes and cleans up volatile and temporary files and directories, based on the configuration file format and location specified in tmpfiles.d directories


Used to list or process pending systemd password requests


Tells init which run-level to change to


Used to query and change the system clock and its settings


Generic udev administration tool: controls the udevd daemon, provides info from the Udev database, monitors uevents, waits for uevents to finish, tests udev configuration, and triggers uevents for a given device


The main systemd utility library


A library to access Udev device information