source: general/sysutils/systemd.xml@ c4d9b37e

11.3 12.0 12.1 kea ken/TL2024 ken/inkscape-core-mods ken/tuningfonts lazarus lxqt plabs/newcss python3.11 qt5new rahul/power-profiles-daemon renodr/vulkan-addition trunk xry111/llvm18 xry111/xf86-video-removal
Last change on this file since c4d9b37e was c10acfe, checked in by Pierre Labastie <pierre.labastie@…>, 18 months ago

Change ulink to xref for sphinx

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