source: BOOK/final-system/common/systemd.xml@ 44cadbb

systemd
Last change on this file since 44cadbb was 09e511ce, checked in by Chris Staub <chris@…>, 10 years ago

Disable lto for systemd

  • Property mode set to 100644
File size: 23.2 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<sect1 id="ch-system-systemd" role="wrap">
8 <?dbhtml filename="systemd.html"?>
9
10 <title>Systemd-&systemd-version;</title>
11
12 <indexterm zone="ch-system-systemd">
13 <primary sortas="a-systemd">Systemd</primary>
14 </indexterm>
15
16 <sect2 role="package">
17 <title/>
18
19 <para>The systemd package is a system and service manager for Linux
20 operating systems.</para>
21
22 </sect2>
23
24 <sect2 role="installation">
25 <title>Installation of Systemd</title>
26
27 <para os="p1">Systemd 209 merged several libraries into
28 <filename class="libraryfile">libsystemd</filename>, but some packages
29 that use systemd still expect those separate libraries. Apply a patch
30 to allow backwards compatibility with these packages by
31 installing Pkg-config files for the old libraries:</para>
32
33<screen os="p2"><userinput>patch -Np1 -i ../&systemd-compat-patch;</userinput></screen>
34
35 <para os="s1">Prevent the <filename>Makefile</filename> from trying to run
36 <command>setcap</command> on <command>systemd-detect-virt</command>,
37 which will fail if the kernel or file system does not support extended
38 capabilities:</para>
39
40<screen os="s2"><userinput>sed -i '/virt-install-hook /d' Makefile.in</userinput></screen>
41
42 <para os="s3">The <filename>timesyncd.conf</filename> file contains a
43 reference to a non-existent <filename>timesyncd.conf(5)</filename> man
44 page. Remove that reference to avoid possible confusion:</para>
45
46<screen os="s4"><userinput>sed -i '/timesyncd.conf/d' src/timesync/timesyncd.conf.in</userinput></screen>
47
48 <para os="s5">By default, <command>systemd-fsck</command> will run
49 <filename>/sbin/fsck</filename> with the <option>-l</option> option, which
50 applies an <function>flock</function> on the file system being checked.
51 This can conflict with an <function>flock</function> that
52 systemd itself puts on the file system, which could result in problems
53 booting. <command>fsck</command> will be fixed to avoid this problem in a
54 future release of Util-linux, but for now we will work around the issue by
55 simply preventing <command>systemd-fsck</command> from using <option>-l</option>:</para>
56
57<screen os="s6"><userinput>sed -i '/-l/d' src/fsck/fsck.c</userinput></screen>
58
59 <para os="a">Prepare systemd for compilation:</para>
60
61<screen os="b"><userinput>./configure --prefix=/usr \
62 --sysconfdir=/etc --localstatedir=/var \
63 --libexecdir=/usr/lib --docdir=/usr/share/doc/systemd-&systemd-version; \
64 --with-rootprefix="" --with-rootlibdir=/lib \
65 --enable-split-usr --disable-gudev --with-kbd-loadkeys=/bin/loadkeys \
66 --with-kbd-setfont=/bin/setfont --with-dbuspolicydir=/etc/dbus-1/system.d \
67 --with-dbusinterfacedir=/usr/share/dbus-1/interfaces \
68 --with-dbussessionservicedir=/usr/share/dbus-1/services \
69 --with-dbussystemservicedir=/usr/share/dbus-1/system-services \
70 cc_cv_CFLAGS__flto=no</userinput></screen>
71
72 <variablelist os="c">
73 <title>The meaning of the configure options:</title>
74
75 <varlistentry>
76 <term><parameter>--with-root*</parameter></term>
77 <listitem>
78 <para>These switches ensure that core programs and
79 shared libraries are installed in the subdirectories
80 of the root partition.</para>
81 </listitem>
82 </varlistentry>
83
84 <varlistentry>
85 <term><parameter>--enable-split-usr</parameter></term>
86 <listitem>
87 <para>This switch ensures that systemd will work on
88 systems where /bin, /lib and /sbin directories are not
89 symlinks to their /usr counterparts.</para>
90 </listitem>
91 </varlistentry>
92
93 <varlistentry>
94 <term><parameter>--disable-gudev</parameter></term>
95 <listitem>
96 <para>This switch prevents systemd from building
97 <filename class="libraryfile">libgudev</filename> as it requires
98 Glib, which is not installed in CLFS.</para>
99 </listitem>
100 </varlistentry>
101
102 <varlistentry>
103 <term><parameter>--with-dbus*</parameter></term>
104 <listitem>
105 <para>These switches ensure that D-Bus configuration files get
106 installed to the correct locations.</para>
107 </listitem>
108 </varlistentry>
109
110 <varlistentry>
111 <term><parameter>cc_cv_CFLAGS__flto=no</parameter></term>
112 <listitem>
113 <para>This prevents the build system from using GCC's Link-time
114 optimization (LTO), to ensure that systemd's binaries will not try
115 to link to <filename class="libraryfile">libgcc_s</filename>.</para>
116 </listitem>
117 </varlistentry>
118
119 </variablelist>
120
121 <para os="d">Compile the package:</para>
122
123<screen os="e"><userinput>make</userinput></screen>
124
125 <para os="f">Prevent a broken test case from running:</para>
126
127<screen os="g"><userinput remap="test">sed -e "s:test/udev-test.pl::g" \
128 -e "s:test-bus-cleanup\$(EXEEXT) ::g" \
129 -e "s:test-bus-gvariant\$(EXEEXT) ::g" \
130 -i Makefile</userinput></screen>
131
132 <para os="h">To test the results, issue:</para>
133
134<screen os="i"><userinput remap="test">make check</userinput></screen>
135
136 <para os="j">Install the package:</para>
137
138<screen os="k"><userinput>make install</userinput></screen>
139
140 <para os="l">Install documentation files that are not installed by default:</para>
141
142<screen os="m"><userinput>install -v -m644 man/*.html /usr/share/doc/systemd-&systemd-version;</userinput></screen>
143
144 <para os="n">Move the
145 <filename class="libraryfile">nss_myhostname</filename> library to
146 <filename class="directory">/lib</filename>:</para>
147
148<screen os="o"><userinput>mv -v /usr/lib/libnss_myhostname.so.2 /lib</userinput></screen>
149
150 <para os="p">Remove an unnecessary directory:</para>
151
152<screen os="q"><userinput>rm -rfv /usr/lib/rpm</userinput></screen>
153
154 <para os="r">Create symlinks for backwards-compatibility with Sysvinit:</para>
155
156<screen os="s"><userinput>for tool in runlevel reboot shutdown poweroff halt telinit; do
157 ln -sfv ../bin/systemctl /sbin/$tool
158done
159ln -sfv ../lib/systemd/systemd /sbin/init</userinput></screen>
160
161 <para os="t">Modify a configuration file which references a group that
162 doesn't exist:</para>
163
164<screen os="u"><userinput>sed -i "s@root lock@root root@g" /usr/lib/tmpfiles.d/legacy.conf</userinput></screen>
165
166 </sect2>
167
168 <sect2 id="conf-systemd" role="configuration">
169 <title>Configuring Systemd</title>
170
171 <indexterm zone="conf-systemd">
172 <primary sortas="a-systemd">systemd</primary>
173 <secondary>configuring</secondary></indexterm>
174
175 <indexterm zone="conf-systemd">
176 <primary sortas="e-/etc/os-release">/etc/os-release</primary>
177 </indexterm>
178
179 <para>Create <filename>/etc/machine-id</filename> which is needed
180 by Journald:</para>
181
182<screen><userinput>systemd-machine-id-setup</userinput></screen>
183
184 <para>Create a file to identify the operating system.
185 <command>systemd</command> will use this file on boot to put information
186 on the screen.</para>
187
188<screen><userinput>cat &gt; /etc/os-release &lt;&lt; "EOF"
189# Begin /etc/os-release
190
191NAME=Cross-LFS
192ID=clfs
193
194PRETTY_NAME=Cross Linux From Scratch
195ANSI_COLOR=0;33
196
197VERSION=&version;
198VERSION_ID=&versionid;
199
200# End /etc/os-release
201EOF</userinput></screen>
202
203 </sect2>
204
205 <sect2 id="contents-systemd" role="content">
206 <title>Contents of Systemd</title>
207
208 <segmentedlist>
209 <segtitle>Installed programs</segtitle>
210 <segtitle>Installed libraries</segtitle>
211 <segtitle>Installed directories</segtitle>
212
213 <seglistitem>
214 <seg>bootctl, busctl, halt (link to systemctl), hostnamectl,
215 init (link to systemd), journalctl, kernel-install, localectl, loginctl,
216 machinectl, poweroff (link to systemctl), reboot (link to systemctl),
217 runlevel (link to systemctl), shutdown (link to systemctl),
218 systemctl, systemd, system-analyze, systemd-ask-password, systemd-cat,
219 systemd-cgls, systemd-cgtop, systemd-coredumpctl, systemd-delta,
220 systemd-detect-virt, systemd-inhibit, systemd-machine-id-setup,
221 systemd-notify, systemd-nspawn, systemd-run, systemd-stdio-bridge
222 (link to systemd-bus-proxyd), systemd-tmpfiles,
223 systemd-tty-ask-password-agent, telinit (link to systemctl),
224 timedatectl, udevadm</seg>
225 <seg>libnss_myhostname.so, libsystemd.so, libudev.so</seg>
226 <seg>/etc/binfmt.d, /etc/init.d, /etc/kernel, /etc/modules-load.d,
227 /etc/sysctl.d, /etc/systemd, /etc/tmpfiles.d, /etc/udev,
228 /etc/xdg/systemd, /lib/systemd, /lib/udev, /usr/include/systemd,
229 /usr/lib/binfmt.d, /usr/lib/kernel, /usr/lib/modules-load.d,
230 /usr/lib/sysctl.d, /usr/lib/systemd,
231 /usr/share/doc-systemd-&systemd-version;, /usr/share/systemd,
232 /usr/share/zsh, /var/lib/systemd</seg>
233 </seglistitem>
234 </segmentedlist>
235
236 <variablelist>
237 <bridgehead renderas="sect3">Short Descriptions</bridgehead>
238 <?dbfo list-presentation="list"?>
239 <?dbhtml list-presentation="table"?>
240
241 <varlistentry id="bootctl">
242 <term><command>bootctl</command></term>
243 <listitem>
244 <para>Controls the firmware and boot manager settings</para>
245 <indexterm zone="ch-system-systemd bootctl">
246 <primary sortas="b-bootctl">bootctl</primary>
247 </indexterm>
248 </listitem>
249 </varlistentry>
250
251 <varlistentry id="busctl">
252 <term><command>busctl</command></term>
253 <listitem>
254 <para>Introspects and monitors the D-Bus bus</para>
255 <indexterm zone="ch-system-systemd busctl">
256 <primary sortas="b-busctl">busctl</primary>
257 </indexterm>
258 </listitem>
259 </varlistentry>
260
261 <varlistentry id="halt">
262 <term><command>halt</command></term>
263 <listitem>
264 <para>Halts, powers off, or reboots the machine</para>
265 <indexterm zone="ch-system-systemd halt">
266 <primary sortas="b-halt">halt</primary>
267 </indexterm>
268 </listitem>
269 </varlistentry>
270
271 <varlistentry id="hostnamectl">
272 <term><command>hostnamectl</command></term>
273 <listitem>
274 <para>Controls the system hostname</para>
275 <indexterm zone="ch-system-systemd hostnamectl">
276 <primary sortas="b-hostnamectl">hostnamectl</primary>
277 </indexterm>
278 </listitem>
279 </varlistentry>
280
281 <varlistentry id="init">
282 <term><command>init</command></term>
283 <listitem>
284 <para>systemd system and service manager</para>
285 <indexterm zone="ch-system-systemd init">
286 <primary sortas="b-init">init</primary>
287 </indexterm>
288 </listitem>
289 </varlistentry>
290
291 <varlistentry id="journalctl">
292 <term><command>journalctl</command></term>
293 <listitem>
294 <para>Queries the systemd journal</para>
295 <indexterm zone="ch-system-systemd journalctl">
296 <primary sortas="b-journalctl">journalctl</primary>
297 </indexterm>
298 </listitem>
299 </varlistentry>
300
301 <varlistentry id="kernel-install">
302 <term><command>kernel-install</command></term>
303 <listitem>
304 <para>Adds and removes kernel and initramfs images to and from
305 <filename class="directory">/boot</filename></para>
306 <indexterm zone="ch-system-systemd kernel-install">
307 <primary sortas="b-kernel-install">kernel-install</primary>
308 </indexterm>
309 </listitem>
310 </varlistentry>
311
312 <varlistentry id="localectl">
313 <term><command>localectl</command></term>
314 <listitem>
315 <para>Controls the system locale and keyboard layout settings</para>
316 <indexterm zone="ch-system-systemd localectl">
317 <primary sortas="b-localectl">localectl</primary>
318 </indexterm>
319 </listitem>
320 </varlistentry>
321
322 <varlistentry id="loginctl">
323 <term><command>loginctl</command></term>
324 <listitem>
325 <para>Controls the systemd login manager</para>
326 <indexterm zone="ch-system-systemd loginctl">
327 <primary sortas="b-loginctl">loginctl</primary>
328 </indexterm>
329 </listitem>
330 </varlistentry>
331
332 <varlistentry id="machinectl">
333 <term><command>machinectl</command></term>
334 <listitem>
335 <para>Controls the systemd machine manager</para>
336 <indexterm zone="ch-system-systemd machinectl">
337 <primary sortas="b-machinectl">machinectl</primary>
338 </indexterm>
339 </listitem>
340 </varlistentry>
341
342 <varlistentry id="poweroff">
343 <term><command>poweroff</command></term>
344 <listitem>
345 <para>Halts, powers off, or reboots the machine</para>
346 <indexterm zone="ch-system-systemd poweroff">
347 <primary sortas="b-poweroff">poweroff</primary>
348 </indexterm>
349 </listitem>
350 </varlistentry>
351
352 <varlistentry id="reboot">
353 <term><command>reboot</command></term>
354 <listitem>
355 <para>Halts, powers off, or reboots the machine</para>
356 <indexterm zone="ch-system-systemd reboot">
357 <primary sortas="b-reboot">reboot</primary>
358 </indexterm>
359 </listitem>
360 </varlistentry>
361
362 <varlistentry id="runlevel">
363 <term><command>runlevel</command></term>
364 <listitem>
365 <para>Prints previous and current SysV runlevel</para>
366 <indexterm zone="ch-system-systemd runlevel">
367 <primary sortas="b-runlevel">runlevel</primary>
368 </indexterm>
369 </listitem>
370 </varlistentry>
371
372 <varlistentry id="shutdown">
373 <term><command>shutdown</command></term>
374 <listitem>
375 <para>Halts, powers off, or reboots the machine</para>
376 <indexterm zone="ch-system-systemd shutdown">
377 <primary sortas="b-shutdown">shutdown</primary>
378 </indexterm>
379 </listitem>
380 </varlistentry>
381
382 <varlistentry id="systemctl">
383 <term><command>systemctl</command></term>
384 <listitem>
385 <para>Control the systemd system and service manager</para>
386 <indexterm zone="ch-system-systemd systemctl">
387 <primary sortas="b-systemctl">systemctl</primary>
388 </indexterm>
389 </listitem>
390 </varlistentry>
391
392 <varlistentry id="systemd">
393 <term><command>systemd</command></term>
394 <listitem>
395 <para>System and service manager for Linux</para>
396 <indexterm zone="ch-system-systemd systemd">
397 <primary sortas="b-systemd">systemd</primary>
398 </indexterm>
399 </listitem>
400 </varlistentry>
401
402 <varlistentry id="systemd-analyze">
403 <term><command>systemd-analyze</command></term>
404 <listitem>
405 <para>Analyzes system boot-up permformance</para>
406 <indexterm zone="ch-system-systemd systemd-analyze">
407 <primary sortas="b-systemd-analyze">systemd-analyze</primary>
408 </indexterm>
409 </listitem>
410 </varlistentry>
411
412 <varlistentry id="systemd-ask-password">
413 <term><command>systemd-ask-password</command></term>
414 <listitem>
415 <para>Queries the user for a system passphrase, via the
416 TTY or an UI agent.</para>
417 <indexterm zone="ch-system-systemd systemd-ask-password">
418 <primary sortas="b-systemd-ask-password">systemd-ask-password</primary>
419 </indexterm>
420 </listitem>
421 </varlistentry>
422
423 <varlistentry id="systemd-cat">
424 <term><command>systemd-cat</command></term>
425 <listitem>
426 <para>Connects a pipeline or program's output with the journal</para>
427 <indexterm zone="ch-system-systemd systemd-cat">
428 <primary sortas="b-systemd-cat">systemd-cat</primary>
429 </indexterm>
430 </listitem>
431 </varlistentry>
432
433 <varlistentry id="systemd-cgls">
434 <term><command>systemd-cgls</command></term>
435 <listitem>
436 <para>Recursively shows control group contents</para>
437 <indexterm zone="ch-system-systemd systemd-cgls">
438 <primary sortas="b-systemd-cgls">systemd-cgls</primary>
439 </indexterm>
440 </listitem>
441 </varlistentry>
442
443 <varlistentry id="systemd-cgtop">
444 <term><command>systemd-cgtop</command></term>
445 <listitem>
446 <para>Shows top control groups by resource usage</para>
447 <indexterm zone="ch-system-systemd systemd-cgtop">
448 <primary sortas="b-systemd-cgtop">systemd-cgtop</primary>
449 </indexterm>
450 </listitem>
451 </varlistentry>
452
453 <varlistentry id="systemd-coredumpctl">
454 <term><command>systemd-coredumpctl</command></term>
455 <listitem>
456 <para>Retrieves coredumps from the journal</para>
457 <indexterm zone="ch-system-systemd systemd-coredumpctl">
458 <primary sortas="b-systemd-coredumpctl">systemd-coredumpctl</primary>
459 </indexterm>
460 </listitem>
461 </varlistentry>
462
463 <varlistentry id="systemd-delta">
464 <term><command>systemd-delta</command></term>
465 <listitem>
466 <para>Finds overridden configuration files</para>
467 <indexterm zone="ch-system-systemd systemd-delta">
468 <primary sortas="b-systemd-delta">systemd-delta</primary>
469 </indexterm>
470 </listitem>
471 </varlistentry>
472
473 <varlistentry id="systemd-detect-virt">
474 <term><command>systemd-detect-virt</command></term>
475 <listitem>
476 <para>Detects execution in a virtual environment</para>
477 <indexterm zone="ch-system-systemd systemd-detect-virt">
478 <primary sortas="b-systemd-detect-virt">systemd-detect-virt</primary>
479 </indexterm>
480 </listitem>
481 </varlistentry>
482
483 <varlistentry id="systemd-inhibit">
484 <term><command>systemd-inhibit</command></term>
485 <listitem>
486 <para>Executes a program with an inhibition lock taken</para>
487 <indexterm zone="ch-system-systemd systemd-inhibit">
488 <primary sortas="b-systemd-inhibit">systemd-inhibit</primary>
489 </indexterm>
490 </listitem>
491 </varlistentry>
492
493 <varlistentry id="systemd-machine-id-setup">
494 <term><command>systemd-machine-id-setup</command></term>
495 <listitem>
496 <para>Initializes the machine ID in
497 <filename>/etc/machine-id</filename></para>
498 <indexterm zone="ch-system-systemd systemd-machine-id-setup">
499 <primary sortas="b-systemd-machine-id-setup">systemd-machine-id-setup</primary>
500 </indexterm>
501 </listitem>
502 </varlistentry>
503
504 <varlistentry id="systemd-notify">
505 <term><command>systemd-notify</command></term>
506 <listitem>
507 <para>Notifies init system about start-up completion and other daemon
508 status changes</para>
509 <indexterm zone="ch-system-systemd systemd-notify">
510 <primary sortas="b-systemd-notify">systemd-notify</primary>
511 </indexterm>
512 </listitem>
513 </varlistentry>
514
515 <varlistentry id="systemd-nspawn">
516 <term><command>systemd-nspawn</command></term>
517 <listitem>
518 <para>Spawns a namespace container for debugging, testing, and
519 building</para>
520 <indexterm zone="ch-system-systemd systemd-nspawn">
521 <primary sortas="b-systemd-nspawn">systemd-nspawn</primary>
522 </indexterm>
523 </listitem>
524 </varlistentry>
525
526 <varlistentry id="systemd-run">
527 <term><command>systemd-run</command></term>
528 <listitem>
529 <para>Runs programs in transient scope or service units</para>
530 <indexterm zone="ch-system-systemd systemd-run">
531 <primary sortas="b-systemd-run">systemd-run</primary>
532 </indexterm>
533 </listitem>
534 </varlistentry>
535
536 <varlistentry id="systemd-stdio-bridge">
537 <term><command>systemd-stdio-bridge</command></term>
538 <listitem>
539 <para>Connects stdio or a socket to a given bus address</para>
540 <indexterm zone="ch-system-systemd systemd-stdio-bridge">
541 <primary sortas="b-systemd-stdio-bridge">systemd-stdio-bridge</primary>
542 </indexterm>
543 </listitem>
544 </varlistentry>
545
546 <varlistentry id="systemd-tmpfiles">
547 <term><command>systemd-tmpfiles</command></term>
548 <listitem>
549 <para>Creates, deletes, and cleans up volatile and temporary files</para>
550 <indexterm zone="ch-system-systemd systemd-tmpfiles">
551 <primary sortas="b-systemd-tmpfiles">systemd-tmpfiles</primary>
552 </indexterm>
553 </listitem>
554 </varlistentry>
555
556 <varlistentry id="systemd-tty-ask-password-agent">
557 <term><command>systemd-tty-ask-password-agent</command></term>
558 <listitem>
559 <para>Process system password requests</para>
560 <indexterm zone="ch-system-systemd systemd-tty-ask-password-agent">
561 <primary sortas="b-systemd-tty-ask-password-agent">systemd-tty-ask-password-agent</primary>
562 </indexterm>
563 </listitem>
564 </varlistentry>
565
566 <varlistentry id="telinit">
567 <term><command>telinit</command></term>
568 <listitem>
569 <para>Tells <command>init</command> which run-level to change to</para>
570 <indexterm zone="ch-system-systemd telinit">
571 <primary sortas="b-telinit">telinit</primary>
572 </indexterm>
573 </listitem>
574 </varlistentry>
575
576 <varlistentry id="timedatectl">
577 <term><command>timedatectl</command></term>
578 <listitem>
579 <para>Controls the system time and date</para>
580 <indexterm zone="ch-system-systemd timedatectl">
581 <primary sortas="b-timedatectl">timedatectl</primary>
582 </indexterm>
583 </listitem>
584 </varlistentry>
585
586 <varlistentry id="udevadm">
587 <term><command>udevadm</command></term>
588 <listitem>
589 <para>Udev management tool</para>
590 <indexterm zone="ch-system-systemd udevadm">
591 <primary sortas="b-udevadm">udevadm</primary>
592 </indexterm>
593 </listitem>
594 </varlistentry>
595
596 <varlistentry id="libnss_myhostname">
597 <term><filename class="libraryfile">libnss_myhostname</filename></term>
598 <listitem>
599 <para>Plugin for the GNU Name Service Switch (NSS) functionality
600 of Glibc, provding hostname resolution for the locally configured
601 system hostname</para>
602 <indexterm zone="ch-system-systemd libnss_myhostname">
603 <primary sortas="c-libnss_myhostname">libnss_myhostname</primary>
604 </indexterm>
605 </listitem>
606 </varlistentry>
607
608 <varlistentry id="libsystemd">
609 <term><filename class="libraryfile">libsystemd</filename></term>
610 <listitem>
611 <para>Support library for systemd</para>
612 <indexterm zone="ch-system-systemd libsystemd">
613 <primary sortas="c-libsystemd">libsystemd</primary>
614 </indexterm>
615 </listitem>
616 </varlistentry>
617
618 <varlistentry id="libudev">
619 <term><filename class="libraryfile">libudev</filename></term>
620 <listitem>
621 <para>A library interface to Udev device information.</para>
622 <indexterm zone="ch-system-systemd libudev">
623 <primary sortas="c-libudev">libudev</primary>
624 </indexterm>
625 </listitem>
626 </varlistentry>
627
628 </variablelist>
629
630 </sect2>
631
632</sect1>
Note: See TracBrowser for help on using the repository browser.