source: general/sysutils/systemd.xml@ 75e3e09

11.3 12.0 12.1 gimp3 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/soup3 xry111/xf86-video-removal
Last change on this file since 75e3e09 was 6e2eb5cf, checked in by Xi Ruoyao <xry111@…>, 23 months ago

sysutils: URL update

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