source: general/sysutils/systemd.xml@ 7cc0c9d

11.1 11.2 11.3 12.0 12.1 kea ken/TL2024 ken/inkscape-core-mods ken/tuningfonts lazarus lxqt plabs/newcss plabs/python-mods python3.11 qt5new rahul/power-profiles-daemon renodr/vulkan-addition trunk xry111/intltool xry111/llvm18 xry111/soup3 xry111/test-20220226 xry111/xf86-video-removal
Last change on this file since 7cc0c9d was 7cc0c9d, checked in by Douglas R. Reno <renodr@…>, 2 years ago

Package updates:

Update to Mesa-21.3.3
Update to systemd-250

  • Property mode set to 100644
File size: 16.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 <!-- <!ENTITY systemd-download-http "http://anduin.linuxfromscratch.org/LFS/systemd-&systemd-version;-&systemd-stable;.tar.xz"> For whenever we move to a stable snapshot for backports -->
8 <!ENTITY systemd-download-http "https://github.com/systemd/systemd/archive/v&systemd-version;/systemd-&systemd-version;.tar.gz">
9 <!ENTITY systemd-download-ftp " ">
10 <!ENTITY systemd-md5sum "8929beb037c587ada4ed201f19756fe2">
11 <!ENTITY systemd-size "11 MB">
12 <!ENTITY systemd-buildsize "307 MB (with tests)">
13 <!ENTITY systemd-time "2.5 SBU (with tests)">
14
15]>
16
17<sect1 id="systemd" xreflabel="Systemd-&systemd-version;" revision="systemd">
18 <?dbhtml filename="systemd.html"?>
19
20 <sect1info>
21 <date>$Date$</date>
22 </sect1info>
23
24 <title>Systemd-&systemd-version;</title>
25 <!-- Whenever we switch back to stable backports, make sure to add the systemd-stable reference back. -->
26
27 <indexterm zone="systemd">
28 <primary sortas="a-systemd">systemd</primary>
29 </indexterm>
30
31 <sect2 role="package">
32 <title>Introduction to systemd</title>
33
34 <para>
35 While <application>systemd</application> was installed when
36 building LFS, there are many features provided by the package that
37 were not included in the initial installation because
38 <application>Linux-PAM</application> was not yet installed.
39 The <application>systemd</application> package needs to be
40 rebuilt to provide a working <command>systemd-logind</command> service,
41 which provides many additional features for dependent packages.
42 </para>
43
44 &lfs110a_checked;
45
46 <bridgehead renderas="sect3">Package Information</bridgehead>
47 <itemizedlist spacing="compact">
48 <listitem>
49 <para>
50 Download (HTTP): <ulink url="&systemd-download-http;"/>
51 </para>
52 </listitem>
53 <listitem>
54 <para>
55 Download (FTP): <ulink url="&systemd-download-ftp;"/>
56 </para>
57 </listitem>
58 <listitem>
59 <para>
60 Download MD5 sum: &systemd-md5sum;
61 </para>
62 </listitem>
63 <listitem>
64 <para>
65 Download size: &systemd-size;
66 </para>
67 </listitem>
68 <listitem>
69 <para>
70 Estimated disk space required: &systemd-buildsize;
71 </para>
72 </listitem>
73 <listitem>
74 <para>
75 Estimated build time: &systemd-time;
76 </para>
77 </listitem>
78 </itemizedlist>
79
80<!--
81 <bridgehead renderas="sect3">Additional Downloads</bridgehead>
82 <itemizedlist spacing="compact">
83 <listitem>
84 <para>
85 Required patch:
86 <ulink url="&patch-root;/systemd-&systemd-version;-upstream_fixes-1.patch"/>
87 </para>
88 </listitem>
89 </itemizedlist>
90-->
91
92 <bridgehead renderas="sect3">systemd Dependencies</bridgehead>
93
94 <bridgehead renderas="sect4">Required</bridgehead>
95 <para role="required">
96 <xref linkend="Jinja2"/> and
97 <xref linkend="linux-pam"/>
98 </para>
99
100 <bridgehead renderas="sect4">Recommended Runtime Dependencies</bridgehead>
101 <para role="recommended">
102 <xref role="runtime" linkend="polkit"/>
103 </para>
104
105 <bridgehead renderas="sect4">Optional</bridgehead>
106 <para role="optional">
107 <xref linkend="btrfs-progs"/>, <!-- homed may support it, see the C.E.-->
108 <xref linkend="curl"/>,
109 <xref linkend="cryptsetup"/>,
110 <xref linkend="git"/>,
111 <xref linkend="gnutls"/>,
112 <xref linkend="iptables"/>,
113 <xref linkend="libgcrypt"/>,
114 <xref linkend="libidn2"/>,
115 <xref linkend="libpwquality"/>,
116 <xref linkend="libseccomp"/>,
117 <xref linkend="libxkbcommon"/>,
118 <xref linkend="make-ca"/>,
119 <xref linkend="p11-kit"/>,
120 <xref linkend="pcre2"/>,
121 <xref linkend="qemu"/>,
122 <xref linkend="qrencode"/>,
123 <xref linkend="rsync"/>,
124 <xref linkend="valgrind"/>,
125 <xref linkend="zsh"/> (for the zsh completions),
126 <ulink url="https://sourceforge.net/projects/gnu-efi/">gnu-efi</ulink>,
127 <ulink url="https://www.kernel.org/pub/linux/utils/kernel/kexec/">kexec-tools</ulink>,
128 <ulink url="https://github.com/libbpf/libbpf">libbpf</ulink>,
129 <ulink url="https://sourceware.org/elfutils/">libdw</ulink>,
130 <ulink url="https://developers.yubico.com/libfido2/">libfido2</ulink>,
131 <ulink url="https://www.gnu.org/software/libmicrohttpd/">libmicrohttpd</ulink>,
132 <ulink url="http://lz4.github.io/lz4/">lz4</ulink>,
133 <!--<ulink url="http://fukuchi.org/works/qrencode/">qrencode</ulink>,-->
134 <ulink url="https://sourceforge.net/projects/linuxquota/">quota-tools</ulink>,
135 <ulink url="https://pypi.python.org/pypi/Sphinx">Sphinx</ulink>, and
136 <ulink url="https://tpm2-tss.readthedocs.io/en/latest/">tpm2-tss</ulink>
137 </para>
138
139 <bridgehead renderas="sect4">Optional (to rebuild the manual pages)</bridgehead>
140 <para role="optional">
141 <xref linkend="DocBook"/>,
142 <xref linkend="docbook-xsl"/>,
143 <xref linkend="libxslt"/>, and
144 <xref linkend="lxml"/> (to build the index of systemd manual pages)
145 </para>
146
147 <para condition="html" role="usernotes">User Notes:
148 <ulink url="&blfs-wiki;/systemd"/>
149 </para>
150 </sect2>
151
152 <sect2 role="installation">
153 <title>Installation of systemd</title>
154
155<!--
156 <para>
157 Apply a patch to fix a security vulnerability:
158 </para>
159
160<screen><userinput remap="pre">patch -Np1 -i ../systemd-&systemd-version;-upstream_fixes-1.patch</userinput></screen>
161-->
162
163 <para>
164 Remove two unneeded groups,
165 <systemitem class="groupname">render</systemitem> and
166 <systemitem class="groupname">sgx</systemitem>, from the default udev
167 rules:
168 </para>
169
170<screen><userinput remap="pre">sed -i -e 's/GROUP="render"/GROUP="video"/' \
171 -e 's/GROUP="sgx", //' rules.d/50-udev-default.rules.in</userinput></screen>
172
173 <para>
174 Rebuild <application>systemd</application> by running the
175 following commands:
176 </para>
177
178<screen><userinput>mkdir build &amp;&amp;
179cd build &amp;&amp;
180
181meson --prefix=/usr \
182 --buildtype=release \
183 -Dblkid=true \
184 -Ddefault-dnssec=no \
185 -Dfirstboot=false \
186 -Dinstall-tests=false \
187 -Dldconfig=false \
188 -Dman=auto \
189 -Dsysusers=false \
190 -Drpmmacrosdir=no \
191 -Db_lto=false \
192 -Dhomed=false \
193 -Duserdb=false \
194 -Dmode=release \
195 -Dpamconfdir=/etc/pam.d \
196 -Ddocdir=/usr/share/doc/systemd-&systemd-version; \
197 .. &amp;&amp;
198
199ninja</userinput></screen>
200<!-- Regarding homed and userdb, see the note below in Command Explanations-->
201
202 <note>
203 <para>
204 For the best test results, make sure you run the testsuite from
205 a system that is booted by the same
206 <application>systemd</application> version you are rebuilding.
207 </para>
208 </note>
209
210 <para>
211 To test the results, issue:
212 <command>PATH+=:/usr/sbin ninja test</command>.
213 <!-- One test named test-repart needs sfdisk, which is in /usr/sbin. -->
214 </para>
215
216<!--
217 <warning>
218 <para>
219 Installing the package will overwrite all files installed by
220 <application>systemd</application> in LFS. It is critical that
221 nothing uses either <application>systemd</application> or
222 <application>Udev</application> libraries during the installation.
223 The best way to ensure that these libraries are not being used is to
224 run the installation in rescue mode. To switch to rescue mode,
225 run the following command as the
226 <systemitem class="username">root</systemitem> user (from a TTY):
227 </para>
228
229<screen role="root"><userinput>systemctl isolate rescue.target</userinput></screen>
230 </warning>
231 Nobody has reported problems with this in years. Let's comment it. -->
232
233 <para>
234 Now, as the <systemitem class="username">root</systemitem> user:
235 </para>
236
237<screen role="root"><userinput>ninja install</userinput></screen>
238
239 <para>
240 Fix a problem in a systemd unit that can cause extra delays when
241 changing TTYs:
242 </para>
243
244<screen role="root"><userinput>sed -i 's/idle/simple/' /usr/lib/systemd/system/getty@.service</userinput></screen>
245
246 <!-- No longer needed as of systemd-244.
247 <para>
248 Remove a configuration file that causes some problems with PID files:
249 </para>
250
251<screen role="root"><userinput>rm -fv /etc/sysctl.d/50-pid-max.conf</userinput></screen>
252 -->
253 </sect2>
254
255 <sect2 role="commands">
256 <title>Command Explanations</title>
257
258<!-- Not needed with the patch
259 <para>
260 <parameter>-Dc_args=-Wno-format-overflow</parameter>: Prevents an error
261 when building with <application>GCC 10</application>. The default is
262 <option>-Werror=format-overflow</option>,
263 which generates false positives. This switch may be used with previous
264 versions of GCC too.
265 </para>
266-->
267
268 <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
269 href="../../xincludes/meson-buildtype-release.xml"/>
270
271 <para>
272 <parameter>-Dpamconfdir=/etc/pam.d</parameter>: Forces the PAM files to
273 be installed in /etc/pam.d rather than /usr/lib/pam.d.
274 </para>
275
276 <para>
277 <parameter>-Duserdb=false</parameter>: Removes a daemon that does not
278 offer any use under a BLFS configuration. If you wish to enable the
279 <application>userdbd</application> daemon, replace "false" with "true"
280 in the above meson command.
281 </para>
282
283 <para>
284 <parameter>-Dhomed=false</parameter>: Removes a daemon that does not offer
285 any use under a traditional BLFS configuration, especially using accounts
286 created with useradd. To enable systemd-homed, first ensure that you have
287 <xref linkend="cryptsetup"/> and <xref linkend="libpwquality"/>, and then
288 change "false" to "true" in the above meson command.
289 </para>
290
291 <!-- EDITORS NOTE: Explanation on removing userdbd and homed:
292 In BLFS, we do not fully support disk encryption. We offer instructions for
293 building 'cryptsetup' as a dependency, but we do not offer instructions for
294 actually configuring it. In addition, we generally do not include
295 functionality that could potentially conflict with other packages, or that
296 is not of any use to us (in an enterprise configuration using Thin Clients
297 or laptops with LUKS encryption, it could make sense though, but that isn't
298 the configuration that we natively support).
299
300 A few of the complications of systemd-homed include:
301 - SSH Logins
302 - Disk Space Assignments
303 - UID Assignments (chown() on login)
304 (See https://cfp.all-systems-go.io/media/homed-asg2019.pdf)
305
306 In an article I read when systemd-homed was originally unveiled, I remember
307 reading about systemd-homed causing problems with OpenSSH Private Key Auth
308 because the user would have to login at the console in order to unlock
309 their home directory, thus allowing the private key to be unlocked and
310 processed by OpenSSH. Since BLFS does not fully support encrypted disks,
311 and because systemd-homed is incompatible with our usage of useradd /
312 traditional UNIX users and groups, I advise that we take the following
313 approach to avoid any confusion:
314
315 - Leave the added Short Descriptions for homectl and userdbctl
316 - Add the above command explanations and restore the previous behavior
317
318 Should we decide to enable homed by default anytime in the future,
319 let's move cryptsetup to recommended or required.
320
321 I would be open to discussing this after the next systemd version when
322 systemd-homed has matured a bit more. -renodr -->
323
324 </sect2>
325
326 <sect2 role="configuration">
327 <title>Configuring systemd</title>
328
329 <para>
330 The <filename>/etc/pam.d/system-session</filename> file needs to
331 be modified and a new file needs to be created in order for
332 <command>systemd-logind</command> to work correctly. Run the following
333 commands as the <systemitem class="username">root</systemitem> user:
334 </para>
335
336<screen role="root"><userinput>grep 'pam_systemd' /etc/pam.d/system-session ||
337cat &gt;&gt; /etc/pam.d/system-session &lt;&lt; "EOF"
338<literal># Begin Systemd addition
339
340session required pam_loginuid.so
341session optional pam_systemd.so
342
343# End Systemd addition</literal>
344EOF
345
346cat &gt; /etc/pam.d/systemd-user &lt;&lt; "EOF"
347<literal># Begin /etc/pam.d/systemd-user
348
349account required pam_access.so
350account include system-account
351
352session required pam_env.so
353session required pam_limits.so
354session required pam_unix.so
355session required pam_loginuid.so
356session optional pam_keyinit.so force revoke
357session optional pam_systemd.so
358
359auth required pam_deny.so
360password required pam_deny.so
361
362# End /etc/pam.d/systemd-user</literal>
363EOF</userinput></screen>
364
365<!--
366 <para>
367 At this point, you should reload the systemd daemon, and reenter
368 multi-user mode with the following commands (as the
369 <systemitem class="username">root</systemitem> user). If a desktop
370 manager is installed and you wish to reenter the graphical mode,
371 replace <userinput>multi-user.target</userinput> with
372 <userinput>graphical.target</userinput>:
373 </para>
374
375<screen role="root"><userinput>systemctl daemon-reexec
376systemctl start multi-user.target</userinput></screen>-->
377
378 <warning>
379 <para>
380 If upgrading from a previous version of systemd and an
381 initrd is used for system boot, you should generate a new initrd before
382 rebooting the system.
383 </para>
384 </warning>
385
386 </sect2>
387
388 <sect2 role="content">
389 <title>Contents</title>
390
391 <para>
392 A list of the installed files, along with their short
393 descriptions can be found at
394 <ulink url="&lfs-root;/chapter08/systemd.html#contents-systemd"/>.
395 </para>
396
397 <para>
398 Listed below are the newly installed programs
399 along with short descriptions.
400 </para>
401
402 <segmentedlist>
403 <segtitle>Installed Programs</segtitle>
404
405 <seglistitem>
406 <seg>
407 <!-- maybe userdbd/userdbctl can go in LFS, try at next time -->
408 homectl (if <xref linkend="cryptsetup"/> is installed)
409 and userdbctl (optionally)
410 </seg>
411 </seglistitem>
412 </segmentedlist>
413
414 <variablelist>
415 <bridgehead renderas="sect3">Short Descriptions</bridgehead>
416 <?dbfo list-presentation="list"?>
417 <?dbhtml list-presentation="table"?>
418
419 <varlistentry id="homectl">
420 <term><command>homectl</command></term>
421 <listitem>
422 <para>
423 is a tool to create, remove, change, or inspect a home directory
424 managed by <command>systemd-homed</command>; note that it's
425 useless for the classic UNIX users and home directories which
426 we are using in LFS/BLFS book
427 </para>
428 <indexterm zone="systemd homectl">
429 <primary sortas="b-homectl">homectl</primary>
430 </indexterm>
431 </listitem>
432 </varlistentry>
433
434 <varlistentry id="userdbctl">
435 <term><command>userdbctl</command></term>
436 <listitem>
437 <para>
438 inspects users, groups, and group memberships
439 </para>
440 <indexterm zone="systemd userdbctl">
441 <primary sortas="b-userdbctl">userdbctl</primary>
442 </indexterm>
443 </listitem>
444 </varlistentry>
445
446 <varlistentry id="pam_systemd">
447 <term><filename class="libraryfile">pam_systemd.so</filename></term>
448 <listitem>
449 <para>
450 is a PAM module used to register user sessions with the
451 <application>systemd</application> login manager,
452 <command>systemd-logind</command>
453 </para>
454 <indexterm zone="systemd pam_systemd">
455 <primary sortas="c-pam_systemd">pam_systemd.so</primary>
456 </indexterm>
457 </listitem>
458 </varlistentry>
459
460 </variablelist>
461
462 </sect2>
463
464</sect1>
Note: See TracBrowser for help on using the repository browser.