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>First, apply a patch to fix some regressions:</para>
51 <screen><userinput remap="pre">patch -Np1 -i ../systemd-&systemd-version;-upstream_fixes-1.patch</userinput></screen>
53 <para>Create a symlink to work around the xsltproc command not being installed:</para>
55 <screen><userinput remap="pre">ln -sf /bin/true /usr/bin/xsltproc</userinput></screen>
57 <para>Set up the man pages:</para>
59 <screen><userinput remap="pre">tar -xf ../systemd-man-pages-&systemd-version;.tar.xz</userinput></screen>
61 <para>Remove tests that cannot be built in chroot:</para>
63 <screen><userinput remap="pre">sed '181,$ d' -i src/resolve/meson.build</userinput></screen>
65 <para>Remove an unneeded group,
66 <systemitem class="groupname">render</systemitem>, from the default udev
69 <screen><userinput remap="pre">sed -i 's/GROUP="render", //' rules.d/50-udev-default.rules.in</userinput></screen>
71 <para>Prepare systemd for compilation:</para>
73 <screen><userinput remap="configure">mkdir -p build
79 --localstatedir=/var \
84 -Dinstall-tests=false \
85 -Dkmod-path=/bin/kmod \
87 -Dmount-path=/bin/mount \
91 -Dsulogin-path=/sbin/sulogin \
93 -Dumount-path=/bin/umount \
100 -Ddocdir=/usr/share/doc/systemd-&systemd-version; \
101 ..</userinput></screen>
104 <title>The meaning of the meson options:</title>
107 <term><parameter>-D*-path=*</parameter></term>
109 <para>These switches provide the location of binaries needed by
110 systemd at runtime that have not yet been installed.</para>
115 <term><parameter>-Ddefault-dnssec=no</parameter></term>
117 <para>This switch turns off the experimental DNSSEC support.</para>
122 <term><parameter>-Dfirstboot=false</parameter></term>
124 <para>This switch prevents installation of systemd
125 services responsible for setting up the system for
126 the first time. They are not useful for LFS because
127 everything is done manually.</para>
132 <term><parameter>-Dinstall-tests=false</parameter></term>
134 <para>This switch prevents installation of the compiled tests.</para>
139 <term><parameter>-Dldconfig=false</parameter></term>
141 <para>This switch prevents installation of a systemd unit that runs
142 <command>ldconfig</command> at boot, which is not useful for source
143 distributions such as LFS and makes the boot time longer. Remove it
144 if the described feature is desired.</para>
149 <term><parameter>-Droot*</parameter></term>
151 <para>These switches ensure that core programs and
152 shared libraries are installed in subdirectories
153 of the root partition.</para>
158 <term><parameter>-Dsplit-usr=true</parameter></term>
160 <para>This switch ensures that systemd will work on
161 systems where /bin, /lib and /sbin directories are not
162 symlinks to their /usr counterparts.</para>
167 <term><parameter>-Dsysusers=false</parameter></term>
169 <para>This switch prevents installation of systemd
170 services responsible for setting up the
171 <filename>/etc/group</filename> and
172 <filename>/etc/passwd</filename> files. Both files
173 were created earlier in this chapter.</para>
178 <term><parameter>-Drpmmacrosdir=no</parameter></term>
180 <para>This switch disables installation of RPM Macros
181 for use with systemd because LFS does not support RPM.</para>
186 <term><parameter>-D{userdb,homed}=false</parameter></term>
188 <para>Remove two daemons that have dependencies that do not fit
189 the scope of LFS.</para>
194 <term><parameter>-Dmode=release</parameter></term>
196 <para>Disable some features considered experimental by upstream.
203 <para>Compile the package:</para>
205 <screen><userinput remap="make">LANG=en_US.UTF-8 ninja</userinput></screen>
207 <para>Install the package:</para>
209 <screen><userinput remap="install">LANG=en_US.UTF-8 ninja install</userinput></screen>
211 <para>Remove an unnecessary symbolic link:</para>
213 <screen><userinput remap="install">rm -f /usr/bin/xsltproc</userinput></screen>
215 <para>Create the <filename>/etc/machine-id</filename> file needed by
216 <command>systemd-journald</command>:</para>
218 <screen><userinput remap="adjust">systemd-machine-id-setup</userinput></screen>
220 <para>Setup the basic target structure:</para>
222 <screen><userinput remap="adjust">systemctl preset-all</userinput></screen>
224 <para>Disable a service that is known to cause problems with systems that
225 use a network configuration other than what is provided by
226 systemd-networkd:</para>
227 <!-- Observed halting startup with dhcpcd handling the primary NIC -->
229 <screen><userinput remap="adjust">systemctl disable systemd-time-wait-sync.service</userinput></screen>
231 <para>Prevent systemd from resetting the maximum PID value which causes
232 some problems with packages and units in BLFS:</para>
234 <screen><userinput remap="adjust">rm -f /usr/lib/sysctl.d/50-pid-max.conf</userinput></screen>
238 <sect2 id="contents-systemd" role="content">
239 <title>Contents of systemd</title>
242 <segtitle>Installed programs</segtitle>
243 <segtitle>Installed libraries</segtitle>
244 <segtitle>Installed directories</segtitle>
247 <seg>bootctl, busctl, coredumpctl, halt (symlink to systemctl),
248 hostnamectl, init, journalctl, kernel-install, localectl, loginctl,
249 machinectl, networkctl, portablectl, poweroff (symlink to
250 systemctl), reboot (symlink to systemctl), resolvconf (symlink to
251 resolvectl), resolvectl, runlevel (symlink to systemctl), shutdown
252 (symlink to systemctl), systemctl, systemd-analyze,
253 systemd-ask-password, systemd-cat, systemd-cgls, systemd-cgtop,
254 systemd-delta, systemd-detect-virt, systemd-dissect, systemd-escape,
255 systemd-hwdb, systemd-id128, systemd-inhibit, systemd-machine-id-setup,
256 systemd-mount, systemd-notify, systemd-nspawn, systemd-path,
257 systemd-repart, systemd-resolve (symlink to resolvectl), systemd-run,
258 systemd-socket-activate, systemd-stdio-bridge, systemd-tmpfiles,
259 systemd-tty-ask-password-agent, systemd-umount (symlink to
260 systemd-mount), telinit (symlink to systemctl), timedatectl, and
262 <seg>libnss_myhostname.so.2, libnss_mymachines.so.2,
263 libnss_resolve.so.2, libnss_systemd.so.2,
264 libsystemd.so, libsystemd-shared-&systemd-version;.so (in /lib/systemd),
266 <seg>/etc/binfmt.d, /etc/init.d, /etc/kernel, /etc/modules-load.d,
267 /etc/sysctl.d, /etc/systemd, /etc/tmpfiles.d, /etc/udev,
268 /etc/xdg/systemd, /lib/systemd, /lib/udev, /usr/include/systemd,
269 /usr/lib/binfmt.d, /usr/lib/environment.d, /usr/lib/kernel,
270 /usr/lib/modules-load.d, /usr/lib/sysctl.d, /usr/lib/systemd,
272 /usr/share/doc/systemd-&systemd-version;, /usr/share/factory,
273 /usr/share/systemd, /var/lib/systemd, and /var/log/journal</seg>
278 <bridgehead renderas="sect3">Short Descriptions</bridgehead>
279 <?dbfo list-presentation="list"?>
280 <?dbhtml list-presentation="table"?>
282 <varlistentry id="bootctl">
283 <term><command>bootctl</command></term>
285 <para>Is used to query the firmware and boot manager settings</para>
286 <indexterm zone="ch-system-systemd bootctl">
287 <primary sortas="b-bootctl">bootctl</primary>
292 <varlistentry id="busctl">
293 <term><command>busctl</command></term>
295 <para>Is used to introspect and monitor the D-Bus bus</para>
296 <indexterm zone="ch-system-systemd busctl">
297 <primary sortas="b-busctl">busctl</primary>
302 <varlistentry id="coredumpctl">
303 <term><command>coredumpctl</command></term>
305 <para>Is used to retrieve coredumps from the systemd journal</para>
306 <indexterm zone="ch-system-systemd coredumpctl">
307 <primary sortas="b-coredumpctl">coredumpctl</primary>
312 <varlistentry id="halt">
313 <term><command>halt</command></term>
315 <para>Normally invokes <command>shutdown</command> with the
316 <parameter>-h</parameter> option, except when already in run-level 0,
317 then it tells the kernel to halt the system; it notes in the
318 file <filename>/var/log/wtmp</filename> that the system is being
320 <indexterm zone="ch-system-systemd halt">
321 <primary sortas="b-halt">halt</primary>
326 <varlistentry id="hostnamectl">
327 <term><command>hostnamectl</command></term>
329 <para>Is used to query and change the system hostname and related
331 <indexterm zone="ch-system-systemd hostnamectl">
332 <primary sortas="b-hostnamectl">hostnamectl</primary>
337 <varlistentry id="init">
338 <term><command>init</command></term>
340 <para>Is the first process to be started when the kernel has initialized
341 the hardware which takes over the boot process and starts all
342 processes according to its configuration files. In this case, it starts
344 <indexterm zone="ch-system-systemd init">
345 <primary sortas="b-init">init</primary>
350 <varlistentry id="journalctl">
351 <term><command>journalctl</command></term>
353 <para>Is used to query the contents of the systemd journal</para>
354 <indexterm zone="ch-system-systemd journalctl">
355 <primary sortas="b-journalctl">journalctl</primary>
360 <varlistentry id="kernel-install">
361 <term><command>kernel-install</command></term>
363 <para>Is used to add and remove kernel and initramfs images to and
364 from /boot. In LFS, this is done manually.</para>
365 <indexterm zone="ch-system-systemd kernel-install">
366 <primary sortas="b-kernel-install">kernel-install</primary>
371 <varlistentry id="localectl">
372 <term><command>localectl</command></term>
374 <para>Is used to query and change the system locale and keyboard layout
376 <indexterm zone="ch-system-systemd localectl">
377 <primary sortas="b-localectl">localectl</primary>
382 <varlistentry id="loginctl">
383 <term><command>loginctl</command></term>
385 <para>Is used to introspect and control the state of the systemd Login
387 <indexterm zone="ch-system-systemd loginctl">
388 <primary sortas="b-loginctl">loginctl</primary>
393 <varlistentry id="machinectl">
394 <term><command>machinectl</command></term>
396 <para>Is used to introspect and control the state of the systemd Virtual
397 Machine and Container Registration Manager</para>
398 <indexterm zone="ch-system-systemd machinectl">
399 <primary sortas="b-machinectl">machinectl</primary>
404 <varlistentry id="networkctl">
405 <term><command>networkctl</command></term>
407 <para>Is used to introspect and configure the state of the network
408 links configured by systemd-networkd</para>
409 <indexterm zone="ch-system-systemd networkctl">
410 <primary sortas="b-networkctl">networkctl</primary>
415 <varlistentry id="portablectl">
416 <term><command>portablectl</command></term>
418 <para>Is used to attach or detach portable services from the local
420 <indexterm zone="ch-system-systemd portablectl">
421 <primary sortas="b-portablectl">portablectl</primary>
426 <varlistentry id="poweroff">
427 <term><command>poweroff</command></term>
429 <para>Instructs the kernel to halt the system and switch off the computer
430 (see <command>halt</command>)</para>
431 <indexterm zone="ch-system-systemd poweroff">
432 <primary sortas="b-poweroff">poweroff</primary>
437 <varlistentry id="reboot">
438 <term><command>reboot</command></term>
440 <para>Instructs the kernel to reboot the system (see
441 <command>halt</command>)</para>
442 <indexterm zone="ch-system-systemd reboot">
443 <primary sortas="b-reboot">reboot</primary>
448 <varlistentry id="resolvconf">
449 <term><command>resolvconf</command></term>
451 <para>Registers DNS server and domain configuration with
452 <command>systemd-resolved</command></para>
453 <indexterm zone="ch-system-systemd resolvconf">
454 <primary sortas="b-resolvconf">resolvconf</primary>
459 <varlistentry id="resolvectl">
460 <term><command>resolvectl</command></term>
462 <para>Sends control commands to the network name resolution
463 manager, or resolves domain names, IPv4 and IPv6 addresses,
464 DNS records, and services.</para>
465 <indexterm zone="ch-system-systemd resolvectl">
466 <primary sortas="b-resolvectl">resolvectl</primary>
471 <varlistentry id="runlevel">
472 <term><command>runlevel</command></term>
474 <para>Outputs the previous and the current run-level, as noted in the
475 last run-level record in <filename>/var/run/utmp</filename></para>
476 <indexterm zone="ch-system-systemd runlevel">
477 <primary sortas="b-runlevel">runlevel</primary>
482 <varlistentry id="shutdown">
483 <term><command>shutdown</command></term>
485 <para>Brings the system down in a safe and secure manner, signaling
486 all processes and notifying all logged-in users</para>
487 <indexterm zone="ch-system-systemd shutdown">
488 <primary sortas="b-shutdown">shutdown</primary>
493 <varlistentry id="systemctl">
494 <term><command>systemctl</command></term>
496 <para>Is used to introspect and control the state of the systemd system
497 and service manager</para>
498 <indexterm zone="ch-system-systemd systemctl">
499 <primary sortas="b-systemctl">systemctl</primary>
504 <varlistentry id="systemd-analyze">
505 <term><command>systemd-analyze</command></term>
507 <para>Is used to determine system startup performance of the current
508 boot, as well as identify troublesome systemd units</para>
509 <indexterm zone="ch-system-systemd systemd-analyze">
510 <primary sortas="b-systemd-analyze">systemd-analyze</primary>
515 <varlistentry id="systemd-ask-password">
516 <term><command>systemd-ask-password</command></term>
518 <para>Is used to query a system password or passphrase from the user,
519 using a question message specified on the command line</para>
520 <indexterm zone="ch-system-systemd systemd-ask-password">
521 <primary sortas="b-systemd-ask-password">systemd-ask-password</primary>
526 <varlistentry id="systemd-cat">
527 <term><command>systemd-cat</command></term>
529 <para>Is used to connect the STDOUT and STDERR outputs of a process
530 with the systemd journal.
532 <indexterm zone="ch-system-systemd systemd-cat">
533 <primary sortas="b-systemd-cat">systemd-cat</primary>
538 <varlistentry id="systemd-cgls">
539 <term><command>systemd-cgls</command></term>
541 <para>Recursively shows the contents of the selected Linux control
542 group hierarchy in a tree</para>
543 <indexterm zone="ch-system-systemd systemd-cgls">
544 <primary sortas="b-systemd-cgls">systemd-cgls</primary>
549 <varlistentry id="systemd-cgtop">
550 <term><command>systemd-cgtop</command></term>
552 <para>Shows the top control groups of the local Linux control group
553 hierarchy, ordered by their CPU, memory and disk I/O load</para>
554 <indexterm zone="ch-system-systemd systemd-cgtop">
555 <primary sortas="b-systemd-cgtop">systemd-cgtop</primary>
560 <varlistentry id="systemd-delta">
561 <term><command>systemd-delta</command></term>
563 <para>Is used to identify and compare configuration files in
564 <filename class="directory">/etc</filename> that override default
565 counterparts in <filename class="directory">/usr</filename></para>
566 <indexterm zone="ch-system-systemd systemd-delta">
567 <primary sortas="b-systemd-delta">systemd-delta</primary>
572 <varlistentry id="systemd-detect-virt">
573 <term><command>systemd-detect-virt</command></term>
575 <para>Detects whether the system is being run in a virtual
576 environment, and adjusts udev accordingly.</para>
577 <indexterm zone="ch-system-systemd systemd-detect-virt">
578 <primary sortas="b-systemd-detect-virt">systemd-detect-virt</primary>
583 <varlistentry id="systemd-dissect">
584 <term><command>systemd-dissect</command></term>
586 <para>Is used to inspect OS disk images.</para>
587 <indexterm zone="ch-system-systemd systemd-dissect">
588 <primary sortas="b-systemd-dissect">systemd-dissect</primary>
593 <varlistentry id="systemd-escape">
594 <term><command>systemd-escape</command></term>
596 <para>Is used to escape strings for inclusion in systemd unit
598 <indexterm zone="ch-system-systemd systemd-escape">
599 <primary sortas="b-systemd-escape">systemd-escape</primary>
604 <varlistentry id="systemd-hwdb">
605 <term><command>systemd-hwdb</command></term>
607 <para>Is used to manage the hardware database (hwdb)</para>
608 <indexterm zone="ch-system-systemd systemd-hwdb">
609 <primary sortas="b-systemd-hwdb">systemd-hwdb</primary>
614 <varlistentry id="systemd-id128">
615 <term><command>systemd-id128</command></term>
617 <para>Generates and prints id128 strings</para>
618 <indexterm zone="ch-system-systemd systemd-id128">
619 <primary sortas="b-systemd-id128">systemd-id128</primary>
624 <varlistentry id="systemd-inhibit">
625 <term><command>systemd-inhibit</command></term>
627 <para>Is used to execute a program with a shutdown, sleep or idle
628 inhibitor lock taken, preventing an action such as a system shutdown
629 until the process is completed.</para>
630 <indexterm zone="ch-system-systemd systemd-inhibit">
631 <primary sortas="b-systemd-inhibit">systemd-inhibit</primary>
636 <varlistentry id="systemd-machine-id-setup">
637 <term><command>systemd-machine-id-setup</command></term>
639 <para>Is used by system installer tools to initialize the machine ID
640 stored in <filename>/etc/machine-id</filename> at install time with a
641 randomly generated ID</para>
642 <indexterm zone="ch-system-systemd systemd-machine-id-setup">
643 <primary sortas="b-systemd-machine-id-setup">systemd-machine-id-setup</primary>
648 <varlistentry id="systemd-mount">
649 <term><command>systemd-mount</command></term>
651 <para>Is used to temporarily mount or automount disks.</para>
652 <indexterm zone="ch-system-systemd systemd-mount">
653 <primary sortas="b-systemd-mount">systemd-mount</primary>
658 <varlistentry id="systemd-notify">
659 <term><command>systemd-notify</command></term>
661 <para>Is used by daemon scripts to notify the init system about status
663 <indexterm zone="ch-system-systemd systemd-notify">
664 <primary sortas="b-systemd-notify">systemd-notify</primary>
669 <varlistentry id="systemd-nspawn">
670 <term><command>systemd-nspawn</command></term>
672 <para>Is used to run a command or OS in a light-weight namespace
674 <indexterm zone="ch-system-systemd systemd-nspawn">
675 <primary sortas="b-systemd-nspawn">systemd-nspawn</primary>
680 <varlistentry id="systemd-path">
681 <term><command>systemd-path</command></term>
683 <para>Is used to query system and user paths</para>
684 <indexterm zone="ch-system-systemd systemd-path">
685 <primary sortas="b-systemd-path">systemd-path</primary>
690 <varlistentry id="systemd-repart">
691 <term><command>systemd-repart</command></term>
693 <para>Is used to grow and add partitions to a partition table when
694 systemd is used in an OS image (e.g. a container).</para>
695 <indexterm zone="ch-system-systemd systemd-repart">
696 <primary sortas="b-systemd-repart">systemd-repart</primary>
701 <varlistentry id="systemd-resolve">
702 <term><command>systemd-resolve</command></term>
704 <para>Is used to resolve domain names, IPV4 and IPv6 addresses, DNS
705 resource records, and services</para>
706 <indexterm zone="ch-system-systemd systemd-resolve">
707 <primary sortas="b-systemd-resolve">systemd-resolve</primary>
712 <varlistentry id="systemd-run">
713 <term><command>systemd-run</command></term>
715 <para>Is used to create and start a transient .service or a .scope
716 unit and run the specified command in it. This is useful for
717 validating systemd units.</para>
718 <indexterm zone="ch-system-systemd systemd-run">
719 <primary sortas="b-systemd-run">systemd-run</primary>
724 <varlistentry id="systemd-socket-activate">
725 <term><command>systemd-socket-activate</command></term>
727 <para>Is used to listen on socket devices and launch a process upon
728 a successful connection to the socket.</para>
729 <indexterm zone="ch-system-systemd systemd-socket-activate">
730 <primary sortas="b-systemd-socket-activate">systemd-socket-activate</primary>
735 <varlistentry id="systemd-tmpfiles">
736 <term><command>systemd-tmpfiles</command></term>
738 <para>Creates, deletes and cleans up volatile and temporary files and
739 directories, based on the configuration file format and location
741 <filename class="directory">tmpfiles.d</filename> directories</para>
742 <indexterm zone="ch-system-systemd systemd-tmpfiles">
743 <primary sortas="b-systemd-tmpfiles">systemd-tmpfiles</primary>
748 <varlistentry id="systemd-umount">
749 <term><command>systemd-umount</command></term>
751 <para>Unmounts mount points</para>
752 <indexterm zone="ch-system-systemd systemd-umount">
753 <primary sortas="b-systemd-umount">systemd-umount</primary>
758 <varlistentry id="systemd-tty-ask-password-agent">
759 <term><command>systemd-tty-ask-password-agent</command></term>
761 <para>Is used to list and/or process pending systemd password
763 <indexterm zone="ch-system-systemd systemd-tty-ask-password-agent">
764 <primary sortas="b-systemd-tty-ask-password-agent">systemd-tty-ask-password-agent</primary>
769 <varlistentry id="telinit">
770 <term><command>telinit</command></term>
772 <para>Tells <command>init</command> which run-level to change
774 <indexterm zone="ch-system-systemd telinit">
775 <primary sortas="b-telinit">telinit</primary>
780 <varlistentry id="timedatectl">
781 <term><command>timedatectl</command></term>
783 <para>Is used to query and change the system clock and its settings
785 <indexterm zone="ch-system-systemd timedatectl">
786 <primary sortas="b-timedatectl">timedatectl</primary>
791 <varlistentry id="udevadm">
792 <term><command>udevadm</command></term>
794 <para>Is a generic udev administration tool which controls the udevd
795 daemon, provides info from the Udev hardware database, monitors
796 uevents, waits for uevents to finish, tests udev configuration, and
797 triggers uevents for a given device</para>
798 <indexterm zone="ch-system-systemd udevadm">
799 <primary sortas="b-udevadm">udevadm</primary>
804 <varlistentry id="libsystemd">
805 <term><filename class="libraryfile">libsystemd</filename></term>
807 <para>Is the main systemd utility library</para>
808 <indexterm zone="ch-system-systemd libsystemd">
809 <primary sortas="c-libsystemd">libsystemd</primary>
814 <varlistentry id="libudev">
815 <term><filename class="libraryfile">libudev</filename></term>
817 <para>Is a library to access Udev device information</para>
818 <indexterm zone="ch-system-systemd libudev">
819 <primary sortas="c-libudev">libudev</primary>