source: general/sysutils/systemd.xml@ 206e0be

10.1 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 206e0be was 206e0be, checked in by Douglas R. Reno <renodr@…>, 3 years ago

Update to gnome-disk-utility-3.38.1
Update to xscreensaver-5.45
Update to epiphany-3.38.2
gegl: Add recommended dependency on graphviz. See the comment left in the page for rationale
systemd: Convert external dependency on qrencode to an internal dependency
qrencode: Minor tweaks

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

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