source: general/sysutils/systemd.xml@ 3f2db3a6

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 3f2db3a6 was 3f2db3a6, checked in by Pierre Labastie <pierre.labastie@…>, 19 months ago

Remove sect1info tags

They only contain a date tag that is nowhere used.

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