%general-entities; ]> systemd &systemd-version;
&systemd-url;
Systemd-&systemd-version; systemd <para>The systemd package contains programs for controlling the startup, running, and shutdown of the system.</para> <segmentedlist> <segtitle>&buildtime;</segtitle> <segtitle>&diskspace;</segtitle> <seglistitem> <seg>&systemd-ch6-sbu;</seg> <seg>&systemd-ch6-du;</seg> </seglistitem> </segmentedlist> </sect2> <sect2 role="installation"> <title>Installation of systemd First, apply a patch to fix issues with systemd-networkd on Linux 5.2+ kernels, as well as with AMD Ryzen CPUs: patch -Np1 -i ../systemd-&systemd-version;-networkd_and_rdrand_fixes-1.patch Create a symlink to work around missing xsltproc: ln -sf /tools/bin/true /usr/bin/xsltproc Because we have not yet installed the final version of Util-Linux, create links to the libraries in the approprite location: for file in /tools/lib/lib{blkid,mount,uuid}.so*; do ln -sf $file /usr/lib/ done Set up the man pages: tar -xf ../systemd-man-pages-&systemd-version;.tar.xz Remove tests that cannot be built in chroot: sed '177,$ d' -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 PKG_CONFIG_PATH="/usr/lib/pkgconfig:/tools/lib/pkgconfig" \ LANG=en_US.UTF-8 \ CFLAGS+="-Wno-format-overflow" \ meson --prefix=/usr \ --sysconfdir=/etc \ --localstatedir=/var \ -Dblkid=true \ -Dbuildtype=release \ -Ddefault-dnssec=no \ -Dfirstboot=false \ -Dinstall-tests=false \ -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 \ -Drpmmacrosdir=no \ .. The meaning of the meson options: -D*-path=* 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. -Ddefault-dnssec=no This switch turns off the experimental DNSSEC support. -Dfirstboot=false 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. -Dinstall-tests=false This switch prevents installation of the compiled tests. -Dldconfig=false 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. -Droot* These switches ensure that core programs and shared libraries are installed in the subdirectories of the root partition. -Dsplit-usr=true This switch ensures that systemd will work on systems where /bin, /lib and /sbin directories are not symlinks to their /usr counterparts. -Dsysusers=false 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. -Drpmmacrosdir=no This switch disables installation of RPM Macros for use with systemd because LFS does not support RPM. Compile the package: LANG=en_US.UTF-8 ninja Install the package: LANG=en_US.UTF-8 ninja install Remove an unnecessary symbolic link: rm -f /usr/bin/xsltproc Create the /etc/machine-id file needed by systemd-journald: systemd-machine-id-setup Remove symbolic links to Util-Linux libraries: rm -fv /usr/lib/lib{blkid,uuid,mount}.so* Prevent systemd from creating /run/nologin to allow unprivileged user logins without systemd-logind: rm -f /usr/lib/tmpfiles.d/systemd-nologin.conf Installation of systemd - 32-bit If still in the build directory, step out: cd .. Clean previous build: rm -rf build Create a symlink to work around missing xsltproc: ln -sf /tools/bin/true /usr/bin/xsltproc Because we have not yet installed the final version of Util-Linux, create links to the libraries in the approprite location: for file in /tools/lib32/lib{blkid,mount,uuid}*; do ln -sf $file /usr/lib32/ done Set up the man pages: tar -xf ../systemd-man-pages-&systemd-version;.tar.xz Prepare systemd for compilation: cd build PKG_CONFIG_PATH="/usr/lib32/pkgconfig:/tools/lib32/pkgconfig" \ CC="gcc -m32 -march=i686" \ CXX="g++ -m32 -march=i686" \ 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=/usr/lib32 \ -Dsplit-usr=true \ -Dsulogin-path=/sbin/sulogin \ -Dsysusers=false \ -Dumount-path=/bin/umount \ -Db_lto=false \ .. Compile the package: LANG=en_US.UTF-8 ninja Install the package: LANG=en_US.UTF-8 DESTDIR=$PWD/DESTDIR ninja install cp -Rv DESTDIR/usr/lib32/* /usr/lib32 rm -rf DESTDIR rm -f /usr/bin/xsltproc Installation of systemd - x32-bit If still in the build directory, step out: cd .. Clean previous build: rm -rf build Create a symlink to work around missing xsltproc: ln -sf /tools/bin/true /usr/bin/xsltproc Because we have not yet installed the final version of Util-Linux, create links to the libraries in the approprite location: for file in /tools/libx32/lib{blkid,mount,uuid}*; do ln -sf $file /usr/libx32/ done Set up the man pages: tar -xf ../systemd-man-pages-&systemd-version;.tar.xz Fix an issue on x32: sed '/log_debug/s@PRI_TIMEX@PRIi64@' -i src/timesync/timesyncd-manager.c sed '/long drift_freq;/s@long @int64_t @' -i src/timesync/timesyncd-manager.h Prepare systemd for compilation: cd build PKG_CONFIG_PATH="/tools/libx32/pkgconfig:/usr/libx32/pkgconfig" \ CC="gcc -mx32" \ CXX="g++ -mx32" \ CFLAGS+="-Wno-error=shift-overflow" \ CXXFLAGS+="-Wno-error=shift-overflow" \ 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=/usr/libx32 \ -Dsplit-usr=true \ -Dsulogin-path=/sbin/sulogin \ -Dsysusers=false \ -Dumount-path=/bin/umount \ -Db_lto=false \ .. Compile the package: LANG=en_US.UTF-8 ninja Install the package: LANG=en_US.UTF-8 DESTDIR=$PWD/DESTDIR ninja install cp -Rv DESTDIR/usr/libx32/* /usr/libx32 rm -rf DESTDIR rm -f /usr/bin/xsltproc Contents of systemd Installed programs Installed libraries Installed directories bootctl, busctl, coredumpctl, halt (symlink to systemctl), hostnamectl, init, journalctl, kernel-install, localectl, loginctl, machinectl, networkctl, portablectl, poweroff (symlink to systemctl), reboot (symlink to systemctl), resolvconf (symlink to resolvectl), resolvectl, runlevel (symlink to systemctl), shutdown (symlink to systemctl), systemctl, systemd-analyze, systemd-ask-password, systemd-cat, systemd-cgls, systemd-cgtop, systemd-delta, systemd-detect-virt, systemd-escape, systemd-hwdb, systemd-id128, systemd-inhibit, systemd-machine-id-setup, systemd-mount, systemd-notify, systemd-nspawn, systemd-path, systemd-resolve (symlink to resolvectl), systemd-run, systemd-socket-activate, systemd-stdio-bridge, systemd-tmpfiles, systemd-tty-ask-password-agent, systemd-umount (symlink to systemd-mount), telinit (symlink to systemctl), timedatectl, and udevadm libnss_myhostname.so.2, libnss_mymachines.so.2, libnss_resolve.so.2, libnss_systemd.so.2, libsystemd.so, libsystemd-shared-&systemd-version;.so (in /lib/systemd), and libudev.so /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-&systemd-version;, /usr/share/factory, /usr/share/systemd, /var/lib/systemd, and /var/log/journal Short Descriptions bootctl Used to query the firmware and boot manager settings bootctl busctl Used to introspect and monitor the D-Bus bus busctl coredumpctl Used to retrieve coredumps from the systemd journal coredumpctl halt 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 halt hostnamectl Used to query and change the system hostname and related settings hostnamectl init 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 init journalctl Used to query the contents of the systemd journal journalctl kernel-install Used to add and remove kernel and initramfs images to and from /boot kernel-install localectl Used to query and change the system locale and keyboard layout settings localectl loginctl Used to introspect and control the state of the systemd Login Manager loginctl machinectl Used to introspect and control the state of the systemd Virtual Machine and Container Registration Manager machinectl networkctl Used to introspect the state of the network links as seen by systemd-networkd networkctl portablectl Used to attach or detach portable services from the local system portablectl poweroff Tells the kernel to halt the system and switch off the computer (see halt) poweroff reboot Tells the kernel to reboot the system (see halt) reboot resolvconf Register DNS server and domain configuration with systemd-resolved resolvconf resolvectl Send control commands to the network name resolution manager, or resolve domain names, IPv4 and IPv6 addresses, DNS records, and services. resolvectl runlevel Reports the previous and the current run-level, as noted in the last run-level record in /var/run/utmp runlevel shutdown Brings the system down in a secure way, signaling all processes and notifying all logged-in users shutdown systemctl Used to introspect and control the state of the systemd system and service manager systemctl systemd-analyze Used to determine system boot-up performance of the current boot systemd-analyze systemd-ask-password Used to query a system password or passphrase from the user, using a question message specified on the command line systemd-ask-password systemd-cat Used to connect STDOUT and STDERR of a process with the Journal systemd-cat systemd-cgls Recursively shows the contents of the selected Linux control group hierarchy in a tree systemd-cgls systemd-cgtop Shows the top control groups of the local Linux control group hierarchy, ordered by their CPU, memory and disk I/O load systemd-cgtop systemd-delta Used to identify and compare configuration files in /etc that override default counterparts in /usr systemd-delta systemd-detect-virt Detects execution in a virtualized environment systemd-detect-virt systemd-escape Used to escape strings for inclusion in systemd unit names systemd-escape systemd-hwdb Used to manage hardware database (hwdb) systemd-hwdb systemd-id128 Generate and print id128 strings systemd-id128 systemd-inhibit Used to execute a program with a shutdown, sleep or idle inhibitor lock taken systemd-inhibit systemd-machine-id-setup Used by system installer tools to initialize the machine ID stored in /etc/machine-id at install time with a randomly generated ID systemd-machine-id-setup systemd-mount A tool to temporarily mount or auto-mount a drive. systemd-mount systemd-notify Used by daemon scripts to notify the init system about status changes systemd-notify systemd-nspawn Used to run a command or OS in a light-weight namespace container systemd-nspawn systemd-path Used to query system and user paths systemd-path systemd-resolve Used to resolve domain names, IPV4 and IPv6 addresses, DNS resource records, and services systemd-resolve systemd-run Used to create and start a transient .service or a .scope unit and run the specified command in it systemd-run systemd-socket-activate A tool to listen on socket devices and launch a process upon connection. systemd-socket-activate systemd-tmpfiles Creates, deletes and cleans up volatile and temporary files and directories, based on the configuration file format and location specified in tmpfiles.d directories systemd-tmpfiles systemd-umount Unmount mount points systemd-umount systemd-tty-ask-password-agent Used to list or process pending systemd password requests systemd-tty-ask-password-agent telinit Tells init which run-level to change to telinit timedatectl Used to query and change the system clock and its settings timedatectl udevadm 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 udevadm libsystemd The main systemd utility library libsystemd libudev A library to access Udev device information libudev