source: general/sysutils/systemd.xml@ 427b46a

11.0 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 upgradedb xry111/intltool xry111/llvm18 xry111/soup3 xry111/test-20220226 xry111/xf86-video-removal
Last change on this file since 427b46a was af843de0, checked in by Douglas R. Reno <renodr@…>, 3 years ago

Add systemd patch to allow rfkill to function properly on Linux 5.11+

git-svn-id: svn://svn.linuxfromscratch.org/BLFS/trunk/BOOK@24339 af4574ff-66df-0310-9fd7-8a98e5e911e0

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