1 <?xml version="1.0" encoding="ISO-8859-1"?>
2 <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
3 "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
4 <!ENTITY % general-entities SYSTEM "../general.ent">
8 <sect1 id="ch-system-systemd" role="wrap" revision="systemd">
9 <?dbhtml filename="systemd.html"?>
11 <sect1info condition="script">
12 <productname>systemd</productname>
13 <productnumber>&systemd-version;</productnumber>
14 <address>&systemd-url;</address>
17 <title>Systemd-&systemd-version;</title>
19 <indexterm zone="ch-system-systemd">
20 <primary sortas="a-systemd">systemd</primary>
23 <sect2 role="package">
26 <para>The systemd package contains programs for controlling the startup,
27 running, and shutdown of the system.</para>
30 <segtitle>&buildtime;</segtitle>
31 <segtitle>&diskspace;</segtitle>
34 <seg>&systemd-fin-sbu;</seg>
35 <seg>&systemd-fin-du;</seg>
40 <sect2 role="installation">
41 <title>Installation of systemd</title>
44 <para>First, apply a patch to fix the build with GCC-10 and fix a segfault:</para>
46 <screen><userinput remap="pre">patch -Np1 -i ../systemd-&systemd-version;-gcc_10-fixes-2.patch</userinput></screen>
49 <para>Create a symlink to work around the xsltproc command not being installed:</para>
51 <screen><userinput remap="pre">ln -sf /bin/true /usr/bin/xsltproc</userinput></screen>
53 <para>Set up the man pages:</para>
55 <screen><userinput remap="pre">tar -xf ../systemd-man-pages-&systemd-version;.tar.xz</userinput></screen>
57 <para>Remove tests that cannot be built in chroot:</para>
59 <screen><userinput remap="pre">sed '177,$ d' -i src/resolve/meson.build</userinput></screen>
61 <para>Remove an unneeded group,
62 <systemitem class="groupname">render</systemitem>, from the default udev
65 <screen><userinput remap="pre">sed -i 's/GROUP="render", //' rules.d/50-udev-default.rules.in</userinput></screen>
67 <para>Prepare systemd for compilation:</para>
69 <screen><userinput remap="configure">mkdir -p build
75 --localstatedir=/var \
80 -Dinstall-tests=false \
81 -Dkmod-path=/bin/kmod \
83 -Dmount-path=/bin/mount \
87 -Dsulogin-path=/sbin/sulogin \
89 -Dumount-path=/bin/umount \
95 ..</userinput></screen>
98 <title>The meaning of the meson options:</title>
101 <term><parameter>-D*-path=*</parameter></term>
103 <para>These switches provide the location of binaries needed by
104 systemd at runtime that have not yet been installed.</para>
109 <term><parameter>-Ddefault-dnssec=no</parameter></term>
111 <para>This switch turns off the experimental DNSSEC support.</para>
116 <term><parameter>-Dfirstboot=false</parameter></term>
118 <para>This switch prevents installation of systemd
119 services responsible for setting up the system for
120 the first time. They are not useful for LFS because
121 everything is done manually.</para>
126 <term><parameter>-Dinstall-tests=false</parameter></term>
128 <para>This switch prevents installation of the compiled tests.</para>
133 <term><parameter>-Dldconfig=false</parameter></term>
135 <para>This switch prevents installation of a systemd unit that runs
136 <command>ldconfig</command> at boot, which is not useful for source
137 distributions such as LFS and makes the boot time longer. Remove it
138 if the described feature is desired.</para>
143 <term><parameter>-Droot*</parameter></term>
145 <para>These switches ensure that core programs and
146 shared libraries are installed in subdirectories
147 of the root partition.</para>
152 <term><parameter>-Dsplit-usr=true</parameter></term>
154 <para>This switch ensures that systemd will work on
155 systems where /bin, /lib and /sbin directories are not
156 symlinks to their /usr counterparts.</para>
161 <term><parameter>-Dsysusers=false</parameter></term>
163 <para>This switch prevents installation of systemd
164 services responsible for setting up the
165 <filename>/etc/group</filename> and
166 <filename>/etc/passwd</filename> files. Both files
167 were created earlier in this chapter.</para>
172 <term><parameter>-Drpmmacrosdir=no</parameter></term>
174 <para>This switch disables installation of RPM Macros
175 for use with systemd because LFS does not support RPM.</para>
180 <term><parameter>-D{userdb,homed}=false</parameter></term>
182 <para>Remove two daemons that have dependencies that do not fit
183 the scope of LFS.</para>
189 <para>Compile the package:</para>
191 <screen><userinput remap="make">LANG=en_US.UTF-8 ninja</userinput></screen>
193 <para>Install the package:</para>
195 <screen><userinput remap="install">LANG=en_US.UTF-8 ninja install</userinput></screen>
197 <para>Remove an unnecessary symbolic link:</para>
199 <screen><userinput remap="install">rm -f /usr/bin/xsltproc</userinput></screen>
201 <para>Create the <filename>/etc/machine-id</filename> file needed by
202 <command>systemd-journald</command>:</para>
204 <screen><userinput remap="adjust">systemd-machine-id-setup</userinput></screen>
206 <para>Setup the basic target structure:</para>
208 <screen><userinput remap="adjust">systemctl preset-all</userinput></screen>
210 <para>Disable a service that is known to cause problems with systems that
211 use a network configuration other than what is provided by
212 systemd-networkd:</para>
213 <!-- Observed halting startup with dhcpcd handling the primary NIC -->
215 <screen><userinput remap="adjust">systemctl disable systemd-time-wait-sync.service</userinput></screen>
217 <para>Prevent systemd from resetting the maximum PID value which causes
218 some problems with packages and units in BLFS:</para>
220 <screen><userinput remap="adjust">rm -f /usr/lib/sysctl.d/50-pid-max.conf</userinput></screen>
224 <sect2 id="contents-systemd" role="content">
225 <title>Contents of systemd</title>
228 <segtitle>Installed programs</segtitle>
229 <segtitle>Installed libraries</segtitle>
230 <segtitle>Installed directories</segtitle>
233 <seg>bootctl, busctl, coredumpctl, halt (symlink to systemctl),
234 hostnamectl, init, journalctl, kernel-install, localectl, loginctl,
235 machinectl, networkctl, portablectl, poweroff (symlink to
236 systemctl), reboot (symlink to systemctl), resolvconf (symlink to
237 resolvectl), resolvectl, runlevel (symlink to systemctl), shutdown
238 (symlink to systemctl), systemctl, systemd-analyze,
239 systemd-ask-password, systemd-cat, systemd-cgls, systemd-cgtop,
240 systemd-delta, systemd-detect-virt, systemd-escape, systemd-hwdb,
241 systemd-id128, systemd-inhibit, systemd-machine-id-setup,
242 systemd-mount, systemd-notify, systemd-nspawn, systemd-path,
243 systemd-repart, systemd-resolve (symlink to resolvectl), systemd-run,
244 systemd-socket-activate, systemd-stdio-bridge, systemd-tmpfiles,
245 systemd-tty-ask-password-agent, systemd-umount (symlink to
246 systemd-mount), telinit (symlink to systemctl), timedatectl, and
248 <seg>libnss_myhostname.so.2, libnss_mymachines.so.2,
249 libnss_resolve.so.2, libnss_systemd.so.2,
250 libsystemd.so, libsystemd-shared-&systemd-version;.so (in /lib/systemd),
252 <seg>/etc/binfmt.d, /etc/init.d, /etc/kernel, /etc/modules-load.d,
253 /etc/sysctl.d, /etc/systemd, /etc/tmpfiles.d, /etc/udev,
254 /etc/xdg/systemd, /lib/systemd, /lib/udev, /usr/include/systemd,
255 /usr/lib/binfmt.d, /usr/lib/environment.d, /usr/lib/kernel,
256 /usr/lib/modules-load.d, /usr/lib/sysctl.d, /usr/lib/systemd,
258 /usr/share/doc/systemd-&systemd-version;, /usr/share/factory,
259 /usr/share/systemd, /var/lib/systemd, and /var/log/journal</seg>
264 <bridgehead renderas="sect3">Short Descriptions</bridgehead>
265 <?dbfo list-presentation="list"?>
266 <?dbhtml list-presentation="table"?>
268 <varlistentry id="bootctl">
269 <term><command>bootctl</command></term>
271 <para>Is used to query the firmware and boot manager settings</para>
272 <indexterm zone="ch-system-systemd bootctl">
273 <primary sortas="b-bootctl">bootctl</primary>
278 <varlistentry id="busctl">
279 <term><command>busctl</command></term>
281 <para>Is used to introspect and monitor the D-Bus bus</para>
282 <indexterm zone="ch-system-systemd busctl">
283 <primary sortas="b-busctl">busctl</primary>
288 <varlistentry id="coredumpctl">
289 <term><command>coredumpctl</command></term>
291 <para>Is used to retrieve coredumps from the systemd journal</para>
292 <indexterm zone="ch-system-systemd coredumpctl">
293 <primary sortas="b-coredumpctl">coredumpctl</primary>
298 <varlistentry id="halt">
299 <term><command>halt</command></term>
301 <para>Normally invokes <command>shutdown</command> with the
302 <parameter>-h</parameter> option, except when already in run-level 0,
303 then it tells the kernel to halt the system; it notes in the
304 file <filename>/var/log/wtmp</filename> that the system is being
306 <indexterm zone="ch-system-systemd halt">
307 <primary sortas="b-halt">halt</primary>
312 <varlistentry id="hostnamectl">
313 <term><command>hostnamectl</command></term>
315 <para>Is used to query and change the system hostname and related
317 <indexterm zone="ch-system-systemd hostnamectl">
318 <primary sortas="b-hostnamectl">hostnamectl</primary>
323 <varlistentry id="init">
324 <term><command>init</command></term>
326 <para>Is the first process to be started when the kernel has initialized
327 the hardware which takes over the boot process and starts all
328 processes according to its configuration files. In this case, it starts
330 <indexterm zone="ch-system-systemd init">
331 <primary sortas="b-init">init</primary>
336 <varlistentry id="journalctl">
337 <term><command>journalctl</command></term>
339 <para>Is used to query the contents of the systemd journal</para>
340 <indexterm zone="ch-system-systemd journalctl">
341 <primary sortas="b-journalctl">journalctl</primary>
346 <varlistentry id="kernel-install">
347 <term><command>kernel-install</command></term>
349 <para>Is used to add and remove kernel and initramfs images to and
350 from /boot. In LFS, this is done manually.</para>
351 <indexterm zone="ch-system-systemd kernel-install">
352 <primary sortas="b-kernel-install">kernel-install</primary>
357 <varlistentry id="localectl">
358 <term><command>localectl</command></term>
360 <para>Is used to query and change the system locale and keyboard layout
362 <indexterm zone="ch-system-systemd localectl">
363 <primary sortas="b-localectl">localectl</primary>
368 <varlistentry id="loginctl">
369 <term><command>loginctl</command></term>
371 <para>Is used to introspect and control the state of the systemd Login
373 <indexterm zone="ch-system-systemd loginctl">
374 <primary sortas="b-loginctl">loginctl</primary>
379 <varlistentry id="machinectl">
380 <term><command>machinectl</command></term>
382 <para>Is used to introspect and control the state of the systemd Virtual
383 Machine and Container Registration Manager</para>
384 <indexterm zone="ch-system-systemd machinectl">
385 <primary sortas="b-machinectl">machinectl</primary>
390 <varlistentry id="networkctl">
391 <term><command>networkctl</command></term>
393 <para>Is used to introspect and configure the state of the network
394 links configured by systemd-networkd</para>
395 <indexterm zone="ch-system-systemd networkctl">
396 <primary sortas="b-networkctl">networkctl</primary>
401 <varlistentry id="portablectl">
402 <term><command>portablectl</command></term>
404 <para>Is used to attach or detach portable services from the local
406 <indexterm zone="ch-system-systemd portablectl">
407 <primary sortas="b-portablectl">portablectl</primary>
412 <varlistentry id="poweroff">
413 <term><command>poweroff</command></term>
415 <para>Instructs the kernel to halt the system and switch off the computer
416 (see <command>halt</command>)</para>
417 <indexterm zone="ch-system-systemd poweroff">
418 <primary sortas="b-poweroff">poweroff</primary>
423 <varlistentry id="reboot">
424 <term><command>reboot</command></term>
426 <para>Instructs the kernel to reboot the system (see
427 <command>halt</command>)</para>
428 <indexterm zone="ch-system-systemd reboot">
429 <primary sortas="b-reboot">reboot</primary>
434 <varlistentry id="resolvconf">
435 <term><command>resolvconf</command></term>
437 <para>Registers DNS server and domain configuration with
438 <command>systemd-resolved</command></para>
439 <indexterm zone="ch-system-systemd resolvconf">
440 <primary sortas="b-resolvconf">resolvconf</primary>
445 <varlistentry id="resolvectl">
446 <term><command>resolvectl</command></term>
448 <para>Sends control commands to the network name resolution
449 manager, or resolves domain names, IPv4 and IPv6 addresses,
450 DNS records, and services.</para>
451 <indexterm zone="ch-system-systemd resolvectl">
452 <primary sortas="b-resolvectl">resolvectl</primary>
457 <varlistentry id="runlevel">
458 <term><command>runlevel</command></term>
460 <para>Outputs the previous and the current run-level, as noted in the
461 last run-level record in <filename>/var/run/utmp</filename></para>
462 <indexterm zone="ch-system-systemd runlevel">
463 <primary sortas="b-runlevel">runlevel</primary>
468 <varlistentry id="shutdown">
469 <term><command>shutdown</command></term>
471 <para>Brings the system down in a safe and secure manner, signaling
472 all processes and notifying all logged-in users</para>
473 <indexterm zone="ch-system-systemd shutdown">
474 <primary sortas="b-shutdown">shutdown</primary>
479 <varlistentry id="systemctl">
480 <term><command>systemctl</command></term>
482 <para>Is used to introspect and control the state of the systemd system
483 and service manager</para>
484 <indexterm zone="ch-system-systemd systemctl">
485 <primary sortas="b-systemctl">systemctl</primary>
490 <varlistentry id="systemd-analyze">
491 <term><command>systemd-analyze</command></term>
493 <para>Is used to determine system startup performance of the current
494 boot, as well as identify troublesome systemd units</para>
495 <indexterm zone="ch-system-systemd systemd-analyze">
496 <primary sortas="b-systemd-analyze">systemd-analyze</primary>
501 <varlistentry id="systemd-ask-password">
502 <term><command>systemd-ask-password</command></term>
504 <para>Is used to query a system password or passphrase from the user,
505 using a question message specified on the command line</para>
506 <indexterm zone="ch-system-systemd systemd-ask-password">
507 <primary sortas="b-systemd-ask-password">systemd-ask-password</primary>
512 <varlistentry id="systemd-cat">
513 <term><command>systemd-cat</command></term>
515 <para>Is used to connect the STDOUT and STDERR outputs of a process
516 with the systemd journal.
518 <indexterm zone="ch-system-systemd systemd-cat">
519 <primary sortas="b-systemd-cat">systemd-cat</primary>
524 <varlistentry id="systemd-cgls">
525 <term><command>systemd-cgls</command></term>
527 <para>Recursively shows the contents of the selected Linux control
528 group hierarchy in a tree</para>
529 <indexterm zone="ch-system-systemd systemd-cgls">
530 <primary sortas="b-systemd-cgls">systemd-cgls</primary>
535 <varlistentry id="systemd-cgtop">
536 <term><command>systemd-cgtop</command></term>
538 <para>Shows the top control groups of the local Linux control group
539 hierarchy, ordered by their CPU, memory and disk I/O load</para>
540 <indexterm zone="ch-system-systemd systemd-cgtop">
541 <primary sortas="b-systemd-cgtop">systemd-cgtop</primary>
546 <varlistentry id="systemd-delta">
547 <term><command>systemd-delta</command></term>
549 <para>Is used to identify and compare configuration files in
550 <filename class="directory">/etc</filename> that override default
551 counterparts in <filename class="directory">/usr</filename></para>
552 <indexterm zone="ch-system-systemd systemd-delta">
553 <primary sortas="b-systemd-delta">systemd-delta</primary>
558 <varlistentry id="systemd-detect-virt">
559 <term><command>systemd-detect-virt</command></term>
561 <para>Detects whether the system is being run in a virtual
562 environment, and adjusts udev accordingly.</para>
563 <indexterm zone="ch-system-systemd systemd-detect-virt">
564 <primary sortas="b-systemd-detect-virt">systemd-detect-virt</primary>
569 <varlistentry id="systemd-escape">
570 <term><command>systemd-escape</command></term>
572 <para>Is used to escape strings for inclusion in systemd unit
574 <indexterm zone="ch-system-systemd systemd-escape">
575 <primary sortas="b-systemd-escape">systemd-escape</primary>
580 <varlistentry id="systemd-hwdb">
581 <term><command>systemd-hwdb</command></term>
583 <para>Is used to manage the hardware database (hwdb)</para>
584 <indexterm zone="ch-system-systemd systemd-hwdb">
585 <primary sortas="b-systemd-hwdb">systemd-hwdb</primary>
590 <varlistentry id="systemd-id128">
591 <term><command>systemd-id128</command></term>
593 <para>Generates and prints id128 strings</para>
594 <indexterm zone="ch-system-systemd systemd-id128">
595 <primary sortas="b-systemd-id128">systemd-id128</primary>
600 <varlistentry id="systemd-inhibit">
601 <term><command>systemd-inhibit</command></term>
603 <para>Is used to execute a program with a shutdown, sleep or idle
604 inhibitor lock taken, preventing an action such as a system shutdown
605 until the process is completed.</para>
606 <indexterm zone="ch-system-systemd systemd-inhibit">
607 <primary sortas="b-systemd-inhibit">systemd-inhibit</primary>
612 <varlistentry id="systemd-machine-id-setup">
613 <term><command>systemd-machine-id-setup</command></term>
615 <para>Is used by system installer tools to initialize the machine ID
616 stored in <filename>/etc/machine-id</filename> at install time with a
617 randomly generated ID</para>
618 <indexterm zone="ch-system-systemd systemd-machine-id-setup">
619 <primary sortas="b-systemd-machine-id-setup">systemd-machine-id-setup</primary>
624 <varlistentry id="systemd-mount">
625 <term><command>systemd-mount</command></term>
627 <para>Is used to temporarily mount or automount disks.</para>
628 <indexterm zone="ch-system-systemd systemd-mount">
629 <primary sortas="b-systemd-mount">systemd-mount</primary>
634 <varlistentry id="systemd-notify">
635 <term><command>systemd-notify</command></term>
637 <para>Is used by daemon scripts to notify the init system about status
639 <indexterm zone="ch-system-systemd systemd-notify">
640 <primary sortas="b-systemd-notify">systemd-notify</primary>
645 <varlistentry id="systemd-nspawn">
646 <term><command>systemd-nspawn</command></term>
648 <para>Is used to run a command or OS in a light-weight namespace
650 <indexterm zone="ch-system-systemd systemd-nspawn">
651 <primary sortas="b-systemd-nspawn">systemd-nspawn</primary>
656 <varlistentry id="systemd-path">
657 <term><command>systemd-path</command></term>
659 <para>Is used to query system and user paths</para>
660 <indexterm zone="ch-system-systemd systemd-path">
661 <primary sortas="b-systemd-path">systemd-path</primary>
666 <varlistentry id="systemd-repart">
667 <term><command>systemd-repart</command></term>
669 <para>Is used to grow and add partitions to a partition table when
670 systemd is used in an OS image (e.g. a container).</para>
671 <indexterm zone="ch-system-systemd systemd-repart">
672 <primary sortas="b-systemd-repart">systemd-repart</primary>
677 <varlistentry id="systemd-resolve">
678 <term><command>systemd-resolve</command></term>
680 <para>Is used to resolve domain names, IPV4 and IPv6 addresses, DNS
681 resource records, and services</para>
682 <indexterm zone="ch-system-systemd systemd-resolve">
683 <primary sortas="b-systemd-resolve">systemd-resolve</primary>
688 <varlistentry id="systemd-run">
689 <term><command>systemd-run</command></term>
691 <para>Is used to create and start a transient .service or a .scope
692 unit and run the specified command in it. This is useful for
693 validating systemd units.</para>
694 <indexterm zone="ch-system-systemd systemd-run">
695 <primary sortas="b-systemd-run">systemd-run</primary>
700 <varlistentry id="systemd-socket-activate">
701 <term><command>systemd-socket-activate</command></term>
703 <para>Is used to listen on socket devices and launch a process upon
704 a successful connection to the socket.</para>
705 <indexterm zone="ch-system-systemd systemd-socket-activate">
706 <primary sortas="b-systemd-socket-activate">systemd-socket-activate</primary>
711 <varlistentry id="systemd-tmpfiles">
712 <term><command>systemd-tmpfiles</command></term>
714 <para>Creates, deletes and cleans up volatile and temporary files and
715 directories, based on the configuration file format and location
717 <filename class="directory">tmpfiles.d</filename> directories</para>
718 <indexterm zone="ch-system-systemd systemd-tmpfiles">
719 <primary sortas="b-systemd-tmpfiles">systemd-tmpfiles</primary>
724 <varlistentry id="systemd-umount">
725 <term><command>systemd-umount</command></term>
727 <para>Unmounts mount points</para>
728 <indexterm zone="ch-system-systemd systemd-umount">
729 <primary sortas="b-systemd-umount">systemd-umount</primary>
734 <varlistentry id="systemd-tty-ask-password-agent">
735 <term><command>systemd-tty-ask-password-agent</command></term>
737 <para>Is used to list and/or process pending systemd password
739 <indexterm zone="ch-system-systemd systemd-tty-ask-password-agent">
740 <primary sortas="b-systemd-tty-ask-password-agent">systemd-tty-ask-password-agent</primary>
745 <varlistentry id="telinit">
746 <term><command>telinit</command></term>
748 <para>Tells <command>init</command> which run-level to change
750 <indexterm zone="ch-system-systemd telinit">
751 <primary sortas="b-telinit">telinit</primary>
756 <varlistentry id="timedatectl">
757 <term><command>timedatectl</command></term>
759 <para>Is used to query and change the system clock and its settings
761 <indexterm zone="ch-system-systemd timedatectl">
762 <primary sortas="b-timedatectl">timedatectl</primary>
767 <varlistentry id="udevadm">
768 <term><command>udevadm</command></term>
770 <para>Is a generic udev administration tool which controls the udevd
771 daemon, provides info from the Udev hardware database, monitors
772 uevents, waits for uevents to finish, tests udev configuration, and
773 triggers uevents for a given device</para>
774 <indexterm zone="ch-system-systemd udevadm">
775 <primary sortas="b-udevadm">udevadm</primary>
780 <varlistentry id="libsystemd">
781 <term><filename class="libraryfile">libsystemd</filename></term>
783 <para>Is the main systemd utility library</para>
784 <indexterm zone="ch-system-systemd libsystemd">
785 <primary sortas="c-libsystemd">libsystemd</primary>
790 <varlistentry id="libudev">
791 <term><filename class="libraryfile">libudev</filename></term>
793 <para>Is a library to access Udev device information</para>
794 <indexterm zone="ch-system-systemd libudev">
795 <primary sortas="c-libudev">libudev</primary>