source: general/sysutils/systemd.xml@ 6a609bd7

10.0 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 6a609bd7 was 6a609bd7, checked in by Xi Ruoyao <xry111@…>, 4 years ago

systemd: allows homectl/homed and userdbctl/userdbd to be built

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

  • Property mode set to 100644
File size: 12.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 "04f02d9841ea5992a16f6b03c873da28">
11 <!ENTITY systemd-size "8.6 MB">
12 <!ENTITY systemd-buildsize "246 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 &lfs91_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<!--
82 <bridgehead renderas="sect3">Additional Downloads</bridgehead>
83 <itemizedlist spacing="compact">
84 <listitem>
85 <para>
86 Required patch:
87 <ulink url="&patch-root;/systemd-&systemd-version;-seccomp_and_cpuaffinity_fix-1.patch"/>
88 </para>
89 </listitem>
90 </itemizedlist>
91-->
92
93 <bridgehead renderas="sect3">systemd Dependencies</bridgehead>
94
95 <bridgehead renderas="sect4">Required</bridgehead>
96 <para role="required">
97 <xref linkend="linux-pam"/>
98 </para>
99
100 <bridgehead renderas="sect4">Recommended Runtime Dependencies</bridgehead>
101 <para role="recommended">
102 <xref role="runtime" linkend="polkit"/>
103 </para>
104
105 <bridgehead renderas="sect4">Optional</bridgehead>
106 <para role="optional">
107 <xref linkend="curl"/>,
108 <xref linkend="cryptsetup"/>,
109 <xref linkend="git"/>,
110 <xref linkend="gnutls"/>,
111 <xref linkend="iptables"/>,
112 <xref linkend="libgcrypt"/>,
113 <xref linkend="libidn2"/>,
114 <xref linkend="libpwquality"/>,
115 <xref linkend="libseccomp"/>,
116 <xref linkend="libxkbcommon"/>,
117 <xref linkend="make-ca"/>,
118 <xref linkend="pcre2"/>,
119 <xref linkend="qemu"/>,
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://www.gnu.org/software/libmicrohttpd/">libmicrohttpd</ulink>,
125 <ulink url="http://lz4.github.io/lz4/">lz4</ulink>,
126 <ulink url="http://fukuchi.org/works/qrencode/">qrencode</ulink>,
127 <ulink url="http://sourceforge.net/projects/linuxquota/">quota-tools</ulink> and
128 <ulink url="https://pypi.python.org/pypi/Sphinx">Sphinx</ulink>
129 </para>
130
131 <bridgehead renderas="sect4">Optional (to rebuild the manual pages)</bridgehead>
132 <para role="optional">
133 <xref linkend="DocBook"/>,
134 <xref linkend="docbook-xsl"/>,
135 <xref linkend="libxslt"/>, and
136 <xref linkend="lxml"/> (to build the index of systemd manual pages)
137 </para>
138
139 <para condition="html" role="usernotes">User Notes:
140 <ulink url="&blfs-wiki;/systemd"/>
141 </para>
142 </sect2>
143
144 <sect2 role="installation">
145 <title>Installation of systemd</title>
146 <!-- 243-244 is now supported, so let's comment this for now.
147 <warning>
148 <para>
149 This version of systemd is incompatible with all previous
150 releases. The BLFS team does not recommend updating in place, and
151 suggests that you do a rebuild instead.
152 </para>
153 </warning>
154 -->
155 <!--
156 <para>
157 Apply a patch to fix problems with libseccomp-2.4.2+ and Linux-5.4+:
158 </para>
159
160<screen><userinput remap="pre">patch -Np1 -i ../systemd-&systemd-version;-seccomp_and_cpuaffinity_fix-1.patch</userinput></screen>
161 -->
162
163 <!-- The above is only needed on systems with Linux 5.4+ and libseccomp-2.4.2+
164 This fix is due to syscall changes in libseccomp+Linux 5.4+.
165 The affected syscall is shmat(), which isn't implemented properly on
166 i686, and intermittently fails on x86_64. Also, there is a problem with
167 CPU Affinity + CGroups on Linux-5.4+ that causes issues with the
168 "test-execute" test. -->
169
170 <para>
171 Remove an unneeded group,
172 <systemitem class="groupname">render</systemitem>, from the default udev
173 rules:
174 </para>
175
176<screen><userinput remap="pre">sed -i 's/GROUP="render", //' rules.d/50-udev-default.rules.in</userinput></screen>
177
178 <para>
179 Rebuild <application>systemd</application> by running the
180 following commands:
181 </para>
182
183<screen><userinput>mkdir build &amp;&amp;
184cd build &amp;&amp;
185
186meson --prefix=/usr \
187 --sysconfdir=/etc \
188 --localstatedir=/var \
189 -Dblkid=true \
190 -Dbuildtype=release \
191 -Ddefault-dnssec=no \
192 -Dfirstboot=false \
193 -Dinstall-tests=false \
194 -Dldconfig=false \
195 -Dman=auto \
196 -Drootprefix= \
197 -Drootlibdir=/lib \
198 -Dsplit-usr=true \
199 -Dsysusers=false \
200 -Drpmmacrosdir=no \
201 -Db_lto=false \
202 .. &amp;&amp;
203
204ninja</userinput></screen>
205
206 <note>
207 <para>
208 For the best test results, make sure you run the testsuite from
209 a system that is booted by the same
210 <application>systemd</application> version you are rebuilding.
211 </para>
212 </note>
213
214 <para>
215 To test the results, issue: <command>ninja test</command>. <!--One test,
216 <filename>udev-test</filename> (test 273) fails due to changes in
217 the Linux 5.3+ kernel. It does not affect the package's
218 functionality. NO LONGER APPLICABLE AS OF 244 -->
219 </para>
220
221 <warning>
222 <para>
223 Installing the package will overwrite all files installed by
224 <application>systemd</application> in LFS. It is critical that
225 nothing uses either <application>systemd</application> or
226 <application>Udev</application> libraries during the installation.
227 The best way to ensure that these libraries are not being used is to
228 run the installation in rescue mode. To switch to rescue mode,
229 run the following command as the
230 <systemitem class="username">root</systemitem> user (from a TTY):
231 </para>
232
233<screen role="root"><userinput>systemctl isolate rescue.target</userinput></screen>
234 </warning>
235
236 <para>
237 Now, as the <systemitem class="username">root</systemitem> user:
238 </para>
239
240<screen role="root"><userinput>ninja install</userinput></screen>
241 <!-- No longer needed as of systemd-244.
242 <para>
243 Remove a configuration file that causes some problems with PID files:
244 </para>
245
246<screen role="root"><userinput>rm -fv /etc/sysctl.d/50-pid-max.conf</userinput></screen>
247 -->
248 </sect2>
249
250 <sect2 role="configuration">
251 <title>Configuring systemd</title>
252
253 <para>
254 The <filename>/etc/pam.d/system-session</filename> file needs to
255 be modified and a new file needs to be created in order for
256 <command>systemd-logind</command> to work correctly. Run the following
257 commands as the <systemitem class="username">root</systemitem> user:
258 </para>
259
260<screen role="root"><userinput>cat &gt;&gt; /etc/pam.d/system-session &lt;&lt; "EOF"
261<literal># Begin Systemd addition
262
263session required pam_loginuid.so
264session optional pam_systemd.so
265
266# End Systemd addition</literal>
267EOF
268
269cat &gt; /etc/pam.d/systemd-user &lt;&lt; "EOF"
270<literal># Begin /etc/pam.d/systemd-user
271
272account required pam_access.so
273account include system-account
274
275session required pam_env.so
276session required pam_limits.so
277session required pam_unix.so
278session required pam_loginuid.so
279session optional pam_keyinit.so force revoke
280session optional pam_systemd.so
281
282auth required pam_deny.so
283password required pam_deny.so
284
285# End /etc/pam.d/systemd-user</literal>
286EOF</userinput></screen>
287
288 <para>
289 At this point, you should reload the systemd daemon, and reenter
290 multi-user mode with the following commands (as the
291 <systemitem class="username">root</systemitem> user). If a desktop
292 manager is installed and you wish to reenter the graphical mode,
293 replace <userinput>multi-user.target</userinput> with
294 <userinput>graphical.target</userinput>:
295 </para>
296
297<screen role="root"><userinput>systemctl daemon-reexec
298systemctl start multi-user.target</userinput></screen>
299
300 <warning>
301 <para>
302 If upgrading from a previous version of systemd and an
303 initrd is used for system boot, you should generate a new initrd before
304 rebooting the system.
305 </para>
306 </warning>
307
308 </sect2>
309
310 <sect2 role="content">
311 <title>Contents</title>
312
313 <para>
314 A list of the installed files, along with their short
315 descriptions can be found at
316 <ulink url="&lfs-root;/chapter06/systemd.html#contents-systemd"/>.
317 </para>
318
319 <para>
320 Listed below are the newly installed libraries and directories
321 along with short descriptions.
322 </para>
323
324 <segmentedlist>
325 <segtitle>Installed Programs</segtitle>
326 <segtitle>Installed Libraries</segtitle>
327 <segtitle>Installed Directories</segtitle>
328
329 <seglistitem>
330 <seg>
331 <!-- maybe userdbd/userdbctl can go in LFS, try at next time -->
332 homectl (if <xref linkend="cryptsetup"/> is installed)
333 and userdbctl
334 </seg>
335 <seg>
336 pam_systemd.so
337 (in <filename class="directory">/lib/security</filename>)
338 </seg>
339 <seg>
340 None
341 </seg>
342 </seglistitem>
343 </segmentedlist>
344
345 <variablelist>
346 <bridgehead renderas="sect3">Short Descriptions</bridgehead>
347 <?dbfo list-presentation="list"?>
348 <?dbhtml list-presentation="table"?>
349
350 <varlistentry id="homectl">
351 <term><command>homectl</command></term>
352 <listitem>
353 <para>
354 is a tool to create, remove, change, or inspect a home directory
355 managed by <command>systemd-homed</command>; note that it's
356 useless for the classic UNIX users and home directories which
357 we are using in LFS/BLFS book
358 </para>
359 <indexterm zone="systemd homectl">
360 <primary sortas="b-homectl">homectl</primary>
361 </indexterm>
362 </listitem>
363 </varlistentry>
364
365 <varlistentry id="userdbctl">
366 <term><command>userdbctl</command></term>
367 <listitem>
368 <para>
369 inspect users, groups, and group memberships
370 </para>
371 <indexterm zone="systemd userdbctl">
372 <primary sortas="b-userdbctl">userdbctl</primary>
373 </indexterm>
374 </listitem>
375 </varlistentry>
376
377 <varlistentry id="pam_systemd">
378 <term><filename class="libraryfile">pam_systemd.so</filename></term>
379 <listitem>
380 <para>
381 is a PAM module used to register user sessions with the
382 <application>systemd</application> login manager,
383 <command>systemd-logind</command>.
384 </para>
385 <indexterm zone="systemd pam_systemd">
386 <primary sortas="c-pam_systemd">pam_systemd.so</primary>
387 </indexterm>
388 </listitem>
389 </varlistentry>
390
391 </variablelist>
392
393 </sect2>
394
395</sect1>
Note: See TracBrowser for help on using the repository browser.