source: chapter06/systemd.xml@ 50acf59

7.6-systemd 7.7-systemd 7.8-systemd 7.9-systemd
Last change on this file since 50acf59 was 50acf59, checked in by Krejzi <krejzi@…>, 10 years ago

Add users and groups required by newer systemd. Remove systemd lto workarounds, it has been fixed in version 214.

git-svn-id: http://svn.linuxfromscratch.org/LFS/branches/systemd/BOOK@10594 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689

  • Property mode set to 100644
File size: 23.0 KB
Line 
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">
5 %general-entities;
6]>
7
8<sect1 id="ch-system-systemd" role="wrap">
9 <?dbhtml filename="systemd.html"?>
10
11 <sect1info condition="script">
12 <productname>systemd</productname>
13 <productnumber>&systemd-version;</productnumber>
14 <address>&systemd-url;</address>
15 </sect1info>
16
17 <title>Systemd-&systemd-version;</title>
18
19 <indexterm zone="ch-system-systemd">
20 <primary sortas="a-Systemd">Systemd</primary>
21 </indexterm>
22
23 <sect2 role="package">
24 <title/>
25
26 <para>The Systemd package contains programs for controlling the startup,
27 running, and shutdown of the system.</para>
28
29 <segmentedlist>
30 <segtitle>&buildtime;</segtitle>
31 <segtitle>&diskspace;</segtitle>
32
33 <seglistitem>
34 <seg>&systemd-ch6-sbu;</seg>
35 <seg>&systemd-ch6-du;</seg>
36 </seglistitem>
37 </segmentedlist>
38 </sect2>
39
40 <sect2 role="installation">
41 <title>Installation of Systemd</title>
42
43 <para>First, create a file to allow Systemd to build when using Util-Linux
44 built in Chapter 5:</para>
45
46<screen><userinput remap="pre">cat &gt; config.cache &lt;&lt; "EOF"
47<literal>KILL=/bin/kill
48HAVE_BLKID=1
49BLKID_LIBS="-lblkid"
50BLKID_CFLAGS="-I/tools/include/blkid"</literal>
51EOF</userinput></screen>
52
53 <para>Additionally, fix a build error when using Util-Linux built in
54 Chapter 5:</para>
55
56<screen><userinput remap="pre">sed -i "s:blkid/::" $(grep -rl "blkid/blkid.h")</userinput></screen>
57
58 <para>Apply a patch so that compat <command>pkg-config</command> files get
59 installed without installing compat libs which are useless on LFS:</para>
60
61<screen><userinput remap="pre">patch -Np1 -i ../&systemd-compat-patch;</userinput></screen>
62
63 <para>Prepare Systemd for compilation:</para>
64
65<screen><userinput remap="configure">./configure --prefix=/usr \
66 --sysconfdir=/etc \
67 --localstatedir=/var \
68 --config-cache \
69 --with-rootprefix= \
70 --with-rootlibdir=/lib \
71 --enable-split-usr \
72 --disable-gudev \
73 --without-python \
74 --docdir=/usr/share/doc/systemd-&systemd-version; \
75 --with-dbuspolicydir=/etc/dbus-1/system.d \
76 --with-dbusinterfacedir=/usr/share/dbus-1/interfaces \
77 --with-dbussessionservicedir=/usr/share/dbus-1/services \
78 --with-dbussystemservicedir=/usr/share/dbus-1/system-services</userinput></screen>
79
80 <variablelist>
81 <title>The meaning of the configure options:</title>
82
83 <varlistentry>
84 <term><parameter>--config-cache</parameter></term>
85 <listitem>
86 <para>This switch tells the build system to use
87 the <filename>config.cache</filename> file which
88 was created earlier.</para>
89 </listitem>
90 </varlistentry>
91
92 <varlistentry>
93 <term><parameter>--with-root*</parameter></term>
94 <listitem>
95 <para>These switches ensure that core programs and
96 shared libraries are installed in the subdirectories
97 of the root partition.</para>
98 </listitem>
99 </varlistentry>
100
101 <varlistentry>
102 <term><parameter>--enable-split-usr</parameter></term>
103 <listitem>
104 <para>This switch ensures that Systemd will work on
105 systems where /bin, /lib and /sbin directories are not
106 symlinks to their /usr counterparts.</para>
107 </listitem>
108 </varlistentry>
109
110 <varlistentry>
111 <term><parameter>--disable-gudev --without-python</parameter></term>
112 <listitem>
113 <para>These switches disable optional features because
114 LFS does not provide their dependencies.</para>
115 </listitem>
116 </varlistentry>
117
118 <varlistentry>
119 <term><parameter>--with-dbus*</parameter></term>
120 <listitem>
121 <para>These switches ensure that D-Bus configuratil files
122 get installed in the correct locations.</para>
123 </listitem>
124 </varlistentry>
125
126 </variablelist>
127
128 <para>Compile the package:</para>
129
130<screen><userinput remap="make">make LIBRARY_PATH=/tools/lib</userinput></screen>
131
132 <para>First prevent few broken test cases from running:</para>
133
134<screen><userinput remap="test">sed -e "s:test/udev-test.pl::g" \
135 -e "s:test-bus-cleanup\$(EXEEXT) ::g" \
136 -e "s:test-bus-gvariant\$(EXEEXT) ::g" \
137 -i Makefile</userinput></screen>
138
139 <para>To test the results, issue:</para>
140
141<screen><userinput remap="test">make -k check</userinput></screen>
142
143 <para>Note that some tests might fail because the test are being run in a
144 chroot environment. For full test coverage, the test suite should be run
145 from a system booted using Systemd.</para>
146
147 <para>Install the package:</para>
148
149<screen><userinput remap="install">make LD_LIBRARY_PATH=/tools/lib install</userinput></screen>
150
151 <para>Move NSS myhostname library to <filename
152 class="directory">/lib</filename>:</para>
153
154<screen><userinput remap="install">mv -v /usr/lib/libnss_myhostname.so.2 /lib</userinput></screen>
155
156 <para>Remove an unnecessary directory:</para>
157
158<screen><userinput remap="install">rm -rfv /usr/lib/rpm</userinput></screen>
159
160 <para>Create the Sysvinit compatibility symlinks, so Systemd is used
161 as the default init system:</para>
162
163<screen><userinput remap="install">for tool in runlevel reboot shutdown poweroff halt telinit; do
164 ln -sfv ../bin/systemctl /sbin/${tool}
165done
166ln -sfv ../lib/systemd/systemd /sbin/init</userinput></screen>
167
168 <para>Remove a reference to a non-existent group:</para>
169
170<screen><userinput remap="install">sed -i "s:0775 root lock:0755 root root:g" /usr/lib/tmpfiles.d/legacy.conf</userinput></screen>
171
172 <para>Create the <filename>/etc/machine-id</filename> file needed by
173 Journald:</para>
174
175<screen><userinput remap="install">systemd-machine-id-setup</userinput></screen>
176
177 </sect2>
178
179 <sect2 id="contents-systemd" role="content">
180 <title>Contents of Systemd</title>
181
182 <segmentedlist>
183 <segtitle>Installed programs</segtitle>
184 <segtitle>Installed libraries</segtitle>
185 <segtitle>Installed directories</segtitle>
186
187 <seglistitem>
188 <seg>bootctl, busctl, halt, hostnamectl, init, journalctl, kernel-install,
189 localectl, loginctl, machinectl, poweroff, reboot, runlevel, shutdown,
190 systemctl, systemd-analyze, systemd-ask-password, systemd-cat, systemd-cgls,
191 systemd-cgtop, systemd-coredumpctl, systemd-delta, systemd-detect-virt,
192 systemd-inhibit, systemd-machine-id-setup, systemd-notify, systemd-nspawn,
193 systemd-run, systemd-stdio-bridge, systemd-tmpfiles, systemd-tty-ask-password-agent,
194 telinit, timedatectl, and udevadm</seg>
195
196 <seg>libnss_myhostname.so.2, libsystemd.so, libudev.so</seg>
197 <seg>/etc/binfmt.d, /etc/init.d, /etc/kernel, /etc/modules-load.d,
198 /etc/sysctl.d, /etc/systemd, /etc/tmpfiles.d, /etc/udev,
199 /etc/xdg/systemd, /lib/systemd, /lib/udev, /usr/include/systemd,
200 /usr/lib/binfmt.d, /usr/lib/kernel, /usr/lib/modules-load.d,
201 /usr/lib/sysctl.d, /usr/lib/systemd, /usr/lib/tmpfiles.d,
202 /usr/share/doc/systemd-&systemd-version;, /usr/share/systemd,
203 /var/lib/systemd, /var/log/journal</seg>
204 </seglistitem>
205 </segmentedlist>
206
207 <variablelist>
208 <bridgehead renderas="sect3">Short Descriptions</bridgehead>
209 <?dbfo list-presentation="list"?>
210 <?dbhtml list-presentation="table"?>
211
212 <varlistentry id="bootctl">
213 <term><command>bootctl</command></term>
214 <listitem>
215 <para>used to query the firmware and boot manager settings.</para>
216 <indexterm zone="ch-system-systemd bootctl">
217 <primary sortas="b-bootctl">bootctl</primary>
218 </indexterm>
219 </listitem>
220 </varlistentry>
221
222 <varlistentry id="busctl">
223 <term><command>busctl</command></term>
224 <listitem>
225 <para>used to introspect and monitor the D-Bus bus.</para>
226 <indexterm zone="ch-system-systemd busctl">
227 <primary sortas="b-busctl">busctl</primary>
228 </indexterm>
229 </listitem>
230 </varlistentry>
231
232 <varlistentry id="halt">
233 <term><command>halt</command></term>
234 <listitem>
235 <para>Normally invokes <command>shutdown</command> with the
236 <parameter>-h</parameter> option, except when already in run-level 0,
237 then it tells the kernel to halt the system; it notes in the
238 file <filename>/var/log/wtmp</filename> that the system is being
239 brought down.</para>
240 <indexterm zone="ch-system-systemd halt">
241 <primary sortas="b-halt">halt</primary>
242 </indexterm>
243 </listitem>
244 </varlistentry>
245
246 <varlistentry id="hostnamectl">
247 <term><command>hostnamectl</command></term>
248 <listitem>
249 <para>used to query and change the system hostname and related
250 settings.</para>
251 <indexterm zone="ch-system-systemd hostnamectl">
252 <primary sortas="b-hostnamectl">hostnamectl</primary>
253 </indexterm>
254 </listitem>
255 </varlistentry>
256
257 <varlistentry id="init">
258 <term><command>init</command></term>
259 <listitem>
260 <para>The first process to be started when the kernel has initialized
261 the hardware which takes over the boot process and starts all the
262 proceses it is instructed to.</para>
263 <indexterm zone="ch-system-systemd init">
264 <primary sortas="b-init">init</primary>
265 </indexterm>
266 </listitem>
267 </varlistentry>
268
269 <varlistentry id="journalctl">
270 <term><command>journalctl</command></term>
271 <listitem>
272 <para>used to query the contents of the Systemd Journal.</para>
273 <indexterm zone="ch-system-systemd journalctl">
274 <primary sortas="b-journalctl">journalctl</primary>
275 </indexterm>
276 </listitem>
277 </varlistentry>
278
279 <varlistentry id="kernel-install">
280 <term><command>kernel-install</command></term>
281 <listitem>
282 <para>used to add and remove kernel and initramfs images to and
283 from /boot.</para>
284 <indexterm zone="ch-system-systemd kernel-install">
285 <primary sortas="b-kernel-install">kernel-install</primary>
286 </indexterm>
287 </listitem>
288 </varlistentry>
289
290 <varlistentry id="localectl">
291 <term><command>localectl</command></term>
292 <listitem>
293 <para>used to query and change the system locale and keyboard layout
294 settings.</para>
295 <indexterm zone="ch-system-systemd localectl">
296 <primary sortas="b-localectl">localectl</primary>
297 </indexterm>
298 </listitem>
299 </varlistentry>
300
301 <varlistentry id="loginctl">
302 <term><command>loginctl</command></term>
303 <listitem>
304 <para>used to introspect and control the state of the Systemd Login
305 Manager.</para>
306 <indexterm zone="ch-system-systemd loginctl">
307 <primary sortas="b-loginctl">loginctl</primary>
308 </indexterm>
309 </listitem>
310 </varlistentry>
311
312 <varlistentry id="machinectl">
313 <term><command>machinectl</command></term>
314 <listitem>
315 <para>used to introspect and control the state of the Systemd Virtual
316 Machine and Container Registration Manager</para>
317 <indexterm zone="ch-system-systemd machinectl">
318 <primary sortas="b-machinectl">machinectl</primary>
319 </indexterm>
320 </listitem>
321 </varlistentry>
322
323 <varlistentry id="poweroff">
324 <term><command>poweroff</command></term>
325 <listitem>
326 <para>Tells the kernel to halt the system and switch off the computer
327 (see <command>halt</command>).</para>
328 <indexterm zone="ch-system-systemd poweroff">
329 <primary sortas="b-poweroff">poweroff</primary>
330 </indexterm>
331 </listitem>
332 </varlistentry>
333
334 <varlistentry id="reboot">
335 <term><command>reboot</command></term>
336 <listitem>
337 <para>Tells the kernel to reboot the system (see
338 <command>halt</command>).</para>
339 <indexterm zone="ch-system-systemd reboot">
340 <primary sortas="b-reboot">reboot</primary>
341 </indexterm>
342 </listitem>
343 </varlistentry>
344
345 <varlistentry id="runlevel">
346 <term><command>runlevel</command></term>
347 <listitem>
348 <para>Reports the previous and the current run-level, as noted in the
349 last run-level record in <filename>/var/run/utmp</filename>.</para>
350 <indexterm zone="ch-system-systemd runlevel">
351 <primary sortas="b-runlevel">runlevel</primary>
352 </indexterm>
353 </listitem>
354 </varlistentry>
355
356 <varlistentry id="shutdown">
357 <term><command>shutdown</command></term>
358 <listitem>
359 <para>Brings the system down in a secure way, signaling all processes
360 and notifying all logged-in users.</para>
361 <indexterm zone="ch-system-systemd shutdown">
362 <primary sortas="b-shutdown">shutdown</primary>
363 </indexterm>
364 </listitem>
365 </varlistentry>
366
367 <varlistentry id="systemctl">
368 <term><command>systemctl</command></term>
369 <listitem>
370 <para>used to introspect and control the state of the Systemd system and
371 service manager.</para>
372 <indexterm zone="ch-system-systemd systemctl">
373 <primary sortas="b-systemctl">systemctl</primary>
374 </indexterm>
375 </listitem>
376 </varlistentry>
377
378 <varlistentry id="systemd-analyze">
379 <term><command>systemd-analyze</command></term>
380 <listitem>
381 <para>used to determine system boot-up performance of the current boot.
382 </para>
383 <indexterm zone="ch-system-systemd systemd-analyze">
384 <primary sortas="b-systemd-analyze">systemd-analyze</primary>
385 </indexterm>
386 </listitem>
387 </varlistentry>
388
389 <varlistentry id="systemd-ask-password">
390 <term><command>systemd-ask-password</command></term>
391 <listitem>
392 <para>used to query a system password or passphrase from the user, using a
393 question message specified on the command line.</para>
394 <indexterm zone="ch-system-systemd systemd-ask-password">
395 <primary sortas="b-systemd-ask-password">systemd-ask-password</primary>
396 </indexterm>
397 </listitem>
398 </varlistentry>
399
400 <varlistentry id="systemd-cat">
401 <term><command>systemd-cat</command></term>
402 <listitem>
403 <para>used to connect STDOUT and STDERR of a process with the Journal.
404 </para>
405 <indexterm zone="ch-system-systemd systemd-cat">
406 <primary sortas="b-systemd-cat">systemd-cat</primary>
407 </indexterm>
408 </listitem>
409 </varlistentry>
410
411 <varlistentry id="systemd-cgls">
412 <term><command>systemd-cgls</command></term>
413 <listitem>
414 <para>recursively shows the contents of the selected Linux control group
415 hierarchy in a tree.</para>
416 <indexterm zone="ch-system-systemd systemd-cgls">
417 <primary sortas="b-systemd-cgls">systemd-cgls</primary>
418 </indexterm>
419 </listitem>
420 </varlistentry>
421
422 <varlistentry id="systemd-cgtop">
423 <term><command>systemd-cgtop</command></term>
424 <listitem>
425 <para>shows the top control groups of the local Linux control group hierarchy,
426 ordered by their CPU, memory and disk I/O load.</para>
427 <indexterm zone="ch-system-systemd systemd-cgtop">
428 <primary sortas="b-systemd-cgtop">systemd-cgtop</primary>
429 </indexterm>
430 </listitem>
431 </varlistentry>
432
433 <varlistentry id="systemd-coredumpctl">
434 <term><command>systemd-coredumpctl</command></term>
435 <listitem>
436 <para>used to retrieve coredumps from the Systemd Journal</para>
437 <indexterm zone="ch-system-systemd systemd-coredumpctl">
438 <primary sortas="b-systemd-coredumpctl">systemd-coredumpctl</primary>
439 </indexterm>
440 </listitem>
441 </varlistentry>
442
443 <varlistentry id="systemd-delta">
444 <term><command>systemd-delta</command></term>
445 <listitem>
446 <para>used to identify and compare configuration files in
447 <filename class="directory">/etc</filename> that override default
448 counterparts in <filename class="directory">/usr</filename>.</para>
449 <indexterm zone="ch-system-systemd systemd-delta">
450 <primary sortas="b-systemd-delta">systemd-delta</primary>
451 </indexterm>
452 </listitem>
453 </varlistentry>
454
455 <varlistentry id="systemd-detect-virt">
456 <term><command>systemd-detect-virt</command></term>
457 <listitem>
458 <para>detects execution in a virtualized environment.</para>
459 <indexterm zone="ch-system-systemd systemd-detect-virt">
460 <primary sortas="b-systemd-detect-virt">systemd-detect-virt</primary>
461 </indexterm>
462 </listitem>
463 </varlistentry>
464
465 <varlistentry id="systemd-inhibit">
466 <term><command>systemd-inhibit</command></term>
467 <listitem>
468 <para>used to execute a program with a shutdown, sleep or idle inhibitor lock
469 taken.</para>
470 <indexterm zone="ch-system-systemd systemd-inhibit">
471 <primary sortas="b-systemd-inhibit">systemd-inhibit</primary>
472 </indexterm>
473 </listitem>
474 </varlistentry>
475
476 <varlistentry id="systemd-machine-id-setup">
477 <term><command>systemd-machine-id-setup</command></term>
478 <listitem>
479 <para>used by system installer tools to initialize the machine ID stored in
480 <filename>/etc/machine-id</filename> at install time with a randomly
481 generated ID.</para>
482 <indexterm zone="ch-system-systemd systemd-machine-id-setup">
483 <primary sortas="b-systemd-machine-id-setup">systemd-machine-id-setup</primary>
484 </indexterm>
485 </listitem>
486 </varlistentry>
487
488 <varlistentry id="systemd-notify">
489 <term><command>systemd-notify</command></term>
490 <listitem>
491 <para>used by daemon scripts to notify the init system about status changes.
492 </para>
493 <indexterm zone="ch-system-systemd systemd-notify">
494 <primary sortas="b-systemd-notify">systemd-notify</primary>
495 </indexterm>
496 </listitem>
497 </varlistentry>
498
499 <varlistentry id="systemd-nspawn">
500 <term><command>systemd-nspawn</command></term>
501 <listitem>
502 <para>used to run a command or OS in a light-weight namespace container.</para>
503 <indexterm zone="ch-system-systemd systemd-nspawn">
504 <primary sortas="b-systemd-nspawn">systemd-nspawn</primary>
505 </indexterm>
506 </listitem>
507 </varlistentry>
508
509 <varlistentry id="systemd-run">
510 <term><command>systemd-run</command></term>
511 <listitem>
512 <para>used to create and start a transient .service or a .scope unit and
513 run the specified command in it.</para>
514 <indexterm zone="ch-system-systemd systemd-run">
515 <primary sortas="b-systemd-run">systemd-run</primary>
516 </indexterm>
517 </listitem>
518 </varlistentry>
519
520<!-- <varlistentry id="systemd-stdio-bridge">
521 <term><command>systemd-stdio-bridge</command></term>
522 <listitem>
523 <para>To be completed</para>
524 <indexterm zone="ch-system-systemd systemd-stdio-bridge">
525 <primary sortas="b-systemd-stdio-bridge">systemd-stdio-bridge</primary>
526 </indexterm>
527 </listitem>
528 </varlistentry> -->
529
530 <varlistentry id="systemd-tmpfiles">
531 <term><command>systemd-tmpfiles</command></term>
532 <listitem>
533 <para>creates, deletes and cleans up volatile and temporary files and directories,
534 based on the configuration file format and location specified in
535 <filename class="directory">tmpfiles.d</filename> directories.</para>
536 <indexterm zone="ch-system-systemd systemd-tmpfiles">
537 <primary sortas="b-systemd-tmpfiles">systemd-tmpfiles</primary>
538 </indexterm>
539 </listitem>
540 </varlistentry>
541
542 <varlistentry id="systemd-tty-ask-password-agent">
543 <term><command>systemd-tty-ask-password-agent</command></term>
544 <listitem>
545 <para>used to list or process pending Systemd password requests</para>
546 <indexterm zone="ch-system-systemd systemd-tty-ask-password-agent">
547 <primary sortas="b-systemd-tty-ask-password-agent">systemd-tty-ask-password-agent</primary>
548 </indexterm>
549 </listitem>
550 </varlistentry>
551
552 <varlistentry id="telinit">
553 <term><command>telinit</command></term>
554 <listitem>
555 <para>Tells <command>init</command> which run-level to change to.</para>
556 <indexterm zone="ch-system-systemd telinit">
557 <primary sortas="b-telinit">telinit</primary>
558 </indexterm>
559 </listitem>
560 </varlistentry>
561
562 <varlistentry id="timedatectl">
563 <term><command>timedatectl</command></term>
564 <listitem>
565 <para>used to query and change the system clock and its settings.
566 </para>
567 <indexterm zone="ch-system-systemd timedatectl">
568 <primary sortas="b-timedatectl">timedatectl</primary>
569 </indexterm>
570 </listitem>
571 </varlistentry>
572
573 <varlistentry id="udevadm">
574 <term><command>udevadm</command></term>
575 <listitem>
576 <para>Generic Udev administration tool: controls the udevd daemon,
577 provides info from the Udev database, monitors uevents, waits for
578 uevents to finish, tests Udev configuration, and triggers uevents
579 for a given device.</para>
580 <indexterm zone="ch-system-systemd udevadm">
581 <primary sortas="b-udevadm">udevadm</primary>
582 </indexterm>
583 </listitem>
584 </varlistentry>
585
586 <varlistentry id="libsystemd">
587 <term><filename class="libraryfile">libsystemd</filename></term>
588 <listitem>
589 <para>Systemd utility library.</para>
590 <indexterm zone="ch-system-systemd libsystemd">
591 <primary sortas="c-libsystemd">libsystemd</primary>
592 </indexterm>
593 </listitem>
594 </varlistentry>
595
596 <varlistentry id="libudev">
597 <term><filename class="libraryfile">libudev</filename></term>
598 <listitem>
599 <para>A library to access Udev device information.</para>
600 <indexterm zone="ch-system-systemd libudev">
601 <primary sortas="c-libudev">libudev</primary>
602 </indexterm>
603 </listitem>
604 </varlistentry>
605
606 </variablelist>
607
608 </sect2>
609
610</sect1>
Note: See TracBrowser for help on using the repository browser.