source: general/sysutils/systemd.xml@ 3947fa9

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/llvm18 xry111/xf86-video-removal
Last change on this file since 3947fa9 was 6c164c6, checked in by Douglas R. Reno <renodr@…>, 19 months ago

Update to systemd-252.

  • Property mode set to 100644
File size: 14.6 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 "https://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 "b9456750a212dd54d81caeb3c38134b6">
11 <!ENTITY systemd-size "11 MB">
12 <!ENTITY systemd-buildsize "307 MB (with tests)">
13 <!ENTITY systemd-time "2.8 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 &lfs112_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<!-- Keep here in case a patch will be needed.-->
81<!--
82 <bridgehead renderas="sect3">Additional Downloads</bridgehead>
83 <itemizedlist spacing="compact">
84 <listitem>
85 <para>
86 Required patch:
87 <ulink url="&patch-root;/systemd-&systemd-version;-glibc_2.36_fix-1.patch"/>
88 </para>
89 </listitem>
90 </itemizedlist>
91-->
92
93 <bridgehead renderas="sect3">systemd Dependencies</bridgehead>
94
95 <bridgehead renderas="sect4">Required</bridgehead>
96 <para role="required">
97 <xref linkend="linux-pam"/>
98 </para>
99
100 <bridgehead renderas="sect4">Recommended Runtime Dependency</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="https://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 First, fix building <application>systemd</application> with glibc-2.36:
158 </para>
159
160<screen><userinput>patch -Np1 -i ../systemd-&systemd-version;-glibc_2.36_fix-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 -Ddefault-dnssec=no \
184 -Dfirstboot=false \
185 -Dinstall-tests=false \
186 -Dldconfig=false \
187 -Dman=auto \
188 -Dsysusers=false \
189 -Drpmmacrosdir=no \
190 -Dhomed=false \
191 -Duserdb=false \
192 -Dmode=release \
193 -Dpam=true \
194 -Dpamconfdir=/etc/pam.d \
195 -Ddocdir=/usr/share/doc/systemd-&systemd-version; \
196 .. &amp;&amp;
197
198ninja</userinput></screen>
199<!-- Regarding homed and userdb, see the note below in Command Explanations-->
200
201 <note>
202 <para>
203 For the best test results, make sure you run the testsuite from
204 a system that is booted by the same
205 <application>systemd</application> version you are rebuilding.
206 </para>
207 </note>
208
209 <para>
210 To test the results, issue:
211 <command>PATH+=:/usr/sbin ninja test</command>.
212 <!-- One test named test-repart needs sfdisk, which is in /usr/sbin. -->
213 </para>
214
215 <para>
216 Now, as the <systemitem class="username">root</systemitem> user:
217 </para>
218
219<screen role="root"><userinput>ninja install</userinput></screen>
220
221 </sect2>
222
223 <sect2 role="commands">
224 <title>Command Explanations</title>
225
226 <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
227 href="../../xincludes/meson-buildtype-release.xml"/>
228
229 <para>
230 <parameter>-Dpamconfdir=/etc/pam.d</parameter>: Forces the PAM files to
231 be installed in /etc/pam.d rather than /usr/lib/pam.d.
232 </para>
233
234 <para>
235 <parameter>-Duserdb=false</parameter>: Removes a daemon that does not
236 offer any use under a BLFS configuration. If you wish to enable the
237 <application>userdbd</application> daemon, replace "false" with "true"
238 in the above meson command.
239 </para>
240
241 <para>
242 <parameter>-Dhomed=false</parameter>: Removes a daemon that does not offer
243 any use under a traditional BLFS configuration, especially using accounts
244 created with useradd. To enable systemd-homed, first ensure that you have
245 <xref linkend="cryptsetup"/> and <xref linkend="libpwquality"/> installed,
246 and then change "false" to "true" in the above meson command.
247 </para>
248
249 <!-- EDITORS NOTE: Explanation on removing userdbd and homed:
250 In BLFS, we do not fully support disk encryption. We offer instructions for
251 building 'cryptsetup' as a dependency, but we do not offer instructions for
252 actually configuring it. In addition, we generally do not include
253 functionality that could potentially conflict with other packages, or that
254 is not of any use to us (in an enterprise configuration using Thin Clients
255 or laptops with LUKS encryption, it could make sense though, but that isn't
256 the configuration that we natively support).
257
258 A few of the complications of systemd-homed include:
259 - SSH Logins
260 - Disk Space Assignments
261 - UID Assignments (chown() on login)
262 (See https://cfp.all-systems-go.io/media/homed-asg2019.pdf)
263
264 In an article I read when systemd-homed was originally unveiled, I remember
265 reading about systemd-homed causing problems with OpenSSH Private Key Auth
266 because the user would have to login at the console in order to unlock
267 their home directory, thus allowing the private key to be unlocked and
268 processed by OpenSSH. Since BLFS does not fully support encrypted disks,
269 and because systemd-homed is incompatible with our usage of useradd /
270 traditional UNIX users and groups, I advise that we take the following
271 approach to avoid any confusion:
272
273 - Leave the added Short Descriptions for homectl and userdbctl
274 - Add the above command explanations and restore the previous behavior
275
276 Should we decide to enable homed by default anytime in the future,
277 let's move cryptsetup to recommended or required.
278
279 I would be open to discussing this after the next systemd version when
280 systemd-homed has matured a bit more. -renodr -->
281
282 </sect2>
283
284 <sect2 role="configuration">
285 <title>Configuring systemd</title>
286
287 <para>
288 The <filename>/etc/pam.d/system-session</filename> file needs to
289 be modified and a new file needs to be created in order for
290 <command>systemd-logind</command> to work correctly. Run the following
291 commands as the <systemitem class="username">root</systemitem> user:
292 </para>
293
294<screen role="root"><userinput>grep 'pam_systemd' /etc/pam.d/system-session ||
295cat &gt;&gt; /etc/pam.d/system-session &lt;&lt; "EOF"
296<literal># Begin Systemd addition
297
298session required pam_loginuid.so
299session optional pam_systemd.so
300
301# End Systemd addition</literal>
302EOF
303
304cat &gt; /etc/pam.d/systemd-user &lt;&lt; "EOF"
305<literal># Begin /etc/pam.d/systemd-user
306
307account required pam_access.so
308account include system-account
309
310session required pam_env.so
311session required pam_limits.so
312session required pam_unix.so
313session required pam_loginuid.so
314session optional pam_keyinit.so force revoke
315session optional pam_systemd.so
316
317auth required pam_deny.so
318password required pam_deny.so
319
320# End /etc/pam.d/systemd-user</literal>
321EOF</userinput></screen>
322
323 <warning>
324 <para>
325 If upgrading from a previous version of systemd and an
326 initrd is used for system boot, you should generate a new initrd before
327 rebooting the system.
328 </para>
329 </warning>
330
331 </sect2>
332
333 <sect2 role="content">
334 <title>Contents</title>
335
336 <para>
337 A list of the installed files, along with their short
338 descriptions can be found at
339 <ulink url="&lfs-root;/chapter08/systemd.html#contents-systemd"/>.
340 </para>
341
342 <para>
343 Listed below are the newly installed programs
344 along with short descriptions.
345 </para>
346
347 <segmentedlist>
348 <segtitle>Installed Programs</segtitle>
349
350 <seglistitem>
351 <seg>
352 <!-- maybe userdbd/userdbctl can go in LFS, try at next time -->
353 homectl (if <xref linkend="cryptsetup"/> is installed),
354 systemd-cryptenroll (if <xref linkend="cryptsetup"/> is installed),
355 and userdbctl (optionally)
356 </seg>
357 </seglistitem>
358 </segmentedlist>
359
360 <variablelist>
361 <bridgehead renderas="sect3">Short Descriptions</bridgehead>
362 <?dbfo list-presentation="list"?>
363 <?dbhtml list-presentation="table"?>
364
365 <varlistentry id="homectl">
366 <term><command>homectl</command></term>
367 <listitem>
368 <para>
369 is a tool to create, remove, change, or inspect a home directory
370 managed by <command>systemd-homed</command>; note that it's
371 useless for the classic UNIX users and home directories which
372 we are using in LFS/BLFS book
373 </para>
374 <indexterm zone="systemd homectl">
375 <primary sortas="b-homectl">homectl</primary>
376 </indexterm>
377 </listitem>
378 </varlistentry>
379
380 <varlistentry id="systemd-cryptenroll">
381 <term><command>systemd-cryptenroll</command></term>
382 <listitem>
383 <para>
384 Is used to enroll or remove a system from full disk encryption,
385 as well as set and query private keys and recovery keys
386 </para>
387 <indexterm zone="systemd systemd-cryptenroll">
388 <primary sortas="b-systemd-cryptenroll">systemd-cryptenroll</primary>
389 </indexterm>
390 </listitem>
391 </varlistentry>
392
393 <varlistentry id="userdbctl">
394 <term><command>userdbctl</command></term>
395 <listitem>
396 <para>
397 inspects users, groups, and group memberships
398 </para>
399 <indexterm zone="systemd userdbctl">
400 <primary sortas="b-userdbctl">userdbctl</primary>
401 </indexterm>
402 </listitem>
403 </varlistentry>
404
405 <varlistentry id="pam_systemd">
406 <term><filename class="libraryfile">pam_systemd.so</filename></term>
407 <listitem>
408 <para>
409 is a PAM module used to register user sessions with the
410 <application>systemd</application> login manager,
411 <command>systemd-logind</command>
412 </para>
413 <indexterm zone="systemd pam_systemd">
414 <primary sortas="c-pam_systemd">pam_systemd.so</primary>
415 </indexterm>
416 </listitem>
417 </varlistentry>
418
419 </variablelist>
420
421 </sect2>
422
423</sect1>
Note: See TracBrowser for help on using the repository browser.