source: chapter06/systemd.xml@ 61ce0b1

7.6-systemd 7.7-systemd 7.8-systemd 7.9-systemd
Last change on this file since 61ce0b1 was 61ce0b1, checked in by DJ Lucas <dj@…>, 10 years ago

Synchronized with LFS-SVN-20140611.

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

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