source: general/sysutils/systemd.xml@ b5d17476

10.0 10.1 11.0 11.1 11.2 11.3 12.0 12.1 8.4 9.0 9.1 bdubbs/svn 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 b5d17476 was b5d17476, checked in by Douglas R. Reno <renodr@…>, 5 years ago

Add systemd secuity patch. All users who have systemd installed should apply this as soon as possible.

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

  • Property mode set to 100644
File size: 10.5 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 "0e4f91b513d4b04e2c10a5173e5a87b2">
11 <!ENTITY systemd-size "7.2 MB">
12 <!ENTITY systemd-buildsize "222 MB (an additonal 11 MB for tests)">
13 <!ENTITY systemd-time "2.2 SBU (&lt; 0.1 SBU for 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 &lfs83_checked;
46
47 <bridgehead renderas="sect3">Package Information</bridgehead>
48 <itemizedlist spacing="compact">
49 <listitem>
50 <para>Download (HTTP): <ulink url="&systemd-download-http;"/></para>
51 </listitem>
52 <listitem>
53 <para>Download (FTP): <ulink url="&systemd-download-ftp;"/></para>
54 </listitem>
55 <listitem>
56 <para>Download MD5 sum: &systemd-md5sum;</para>
57 </listitem>
58 <listitem>
59 <para>Download size: &systemd-size;</para>
60 </listitem>
61 <listitem>
62 <para>Estimated disk space required: &systemd-buildsize;</para>
63 </listitem>
64 <listitem>
65 <para>Estimated build time: &systemd-time;</para>
66 </listitem>
67 </itemizedlist>
68
69 <bridgehead renderas="sect3">Additional Downloads</bridgehead>
70 <itemizedlist spacing="compact">
71 <listitem>
72 <para>
73 Required patch:
74 <ulink url="&patch-root;/systemd-&systemd-version;-security_fixes-1.patch"/>
75 </para>
76 </listitem>
77 </itemizedlist>
78
79 <bridgehead renderas="sect3">systemd Dependencies</bridgehead>
80
81 <bridgehead renderas="sect4">Required</bridgehead>
82 <para role="required">
83 <xref linkend="linux-pam"/>
84 </para>
85
86 <bridgehead renderas="sect4">Recommended Runtime Dependencies</bridgehead>
87 <para role="recommended">
88 <xref role="runtime" linkend="polkit"/>
89 </para>
90
91 <bridgehead renderas="sect4">Optional</bridgehead>
92 <para role="optional">
93 <xref linkend="curl"/>,
94 <xref linkend="cryptsetup"/>,
95 <xref linkend="git"/>,
96 <xref linkend="gnutls"/>,
97 <xref linkend="iptables"/>,
98 <xref linkend="libgcrypt"/>,
99 <xref linkend="libidn2"/>,
100 <xref linkend="libseccomp"/>,
101 <xref linkend="libxkbcommon"/>,
102 <xref linkend="make-ca"/>,
103 <xref linkend="qemu"/>,
104 <xref linkend="valgrind"/>,
105 <xref linkend="zsh"/> (for the zsh completions),
106 <ulink url="http://sourceforge.net/projects/gnu-efi/">gnu-efi</ulink>,
107 <ulink url="https://www.kernel.org/pub/linux/utils/kernel/kexec/">kexec-tools</ulink>,
108 <ulink url="https://www.gnu.org/software/libmicrohttpd/">libmicrohttpd</ulink>,
109 <ulink url="http://lz4.github.io/lz4/">lz4</ulink>,
110 <ulink url="http://fukuchi.org/works/qrencode/">qrencode</ulink>,
111 <ulink url="http://sourceforge.net/projects/linuxquota/">quota-tools</ulink> and
112 <ulink url="https://pypi.python.org/pypi/Sphinx">Sphinx</ulink>
113 </para>
114
115 <bridgehead renderas="sect4">Optional (to rebuild the manual pages)</bridgehead>
116 <para role="optional">
117 <xref linkend="DocBook"/>,
118 <xref linkend="docbook-xsl"/>, and
119 <xref linkend="libxslt"/>
120 </para>
121
122 <para condition="html" role="usernotes">User Notes:
123 <ulink url="&blfs-wiki;/systemd"/>
124 </para>
125 </sect2>
126
127 <sect2 role="installation">
128 <title>Installation of systemd</title>
129
130 <para>Apply a critical security patch for journald:</para>
131
132<screen><userinput remap="pre">patch -Np1 -i ../systemd-&systemd-version;-security_fixes-1.patch</userinput></screen>
133
134 <para>Remove an unneeded group,
135 <systemitem class="groupname">render</systemitem>, from the default udev
136 rules:</para>
137
138<screen><userinput remap="pre">sed -i 's/GROUP="render", //' rules/50-udev-default.rules.in</userinput></screen>
139
140 <para>
141 Rebuild <application>systemd</application> by running the
142 following commands:
143 </para>
144
145<screen><userinput>mkdir build &amp;&amp;
146cd build &amp;&amp;
147
148meson --prefix=/usr \
149 --sysconfdir=/etc \
150 --localstatedir=/var \
151 -Dblkid=true \
152 -Dbuildtype=release \
153 -Ddefault-dnssec=no \
154 -Dfirstboot=false \
155 -Dinstall-tests=false \
156 -Dldconfig=false \
157 -Drootprefix= \
158 -Drootlibdir=/lib \
159 -Dsplit-usr=true \
160 -Dsysusers=false \
161 -Db_lto=false \
162 .. &amp;&amp;
163
164ninja</userinput></screen>
165
166 <note>
167 <para>
168 For the best test results, make sure you run the testsuite from
169 a system that is booted by the same
170 <application>systemd</application> version you are rebuilding.
171 </para>
172 </note>
173
174 <para>
175 To test the results, issue: <command>ninja test</command>. <!--One test,
176 <filename>test-fs-util</filename>, is known to fail.-->
177 <!-- https://github.com/systemd/systemd/pull/10263/commits -->
178 </para>
179
180 <warning>
181 <para>
182 Installing the package will overwrite all files installed by
183 <application>systemd</application> in LFS. It is critical that
184 nothing uses either <application>systemd</application> or
185 <application>Udev</application> libraries during the installation.
186 The best way to ensure that these libraries are not being used is to
187 run the installation in rescue mode. To switch to rescue mode,
188 run the following command as the
189 <systemitem class="username">root</systemitem> user (from a TTY):
190 </para>
191
192<screen role="root"><userinput>systemctl start rescue.target</userinput></screen>
193 </warning>
194
195 <para>
196 Now, as the <systemitem class="username">root</systemitem> user:
197 </para>
198
199<screen role="root"><userinput>ninja install</userinput></screen>
200
201 <para>
202 If <application>RPM</application> is not installed, remove an
203 unnecessary directory by running the following command as the
204 <systemitem class="username">root</systemitem> user:
205 </para>
206
207<screen role="root"><userinput>rm -rfv /usr/lib/rpm</userinput></screen>
208
209 </sect2>
210
211 <sect2 role="configuration">
212 <title>Configuring systemd</title>
213
214 <para>
215 The <filename>/etc/pam.d/system-session</filename> file needs to
216 be modified and a new file needs to be created in order for
217 <command>systemd-logind</command> to work correctly. Run the following
218 commands as the <systemitem class="username">root</systemitem> user:
219 </para>
220
221<screen role="root"><userinput>cat &gt;&gt; /etc/pam.d/system-session &lt;&lt; "EOF"
222<literal># Begin Systemd addition
223
224session required pam_loginuid.so
225session optional pam_systemd.so
226
227# End Systemd addition</literal>
228EOF
229
230cat &gt; /etc/pam.d/systemd-user &lt;&lt; "EOF"
231<literal># Begin /etc/pam.d/systemd-user
232
233account required pam_access.so
234account include system-account
235
236session required pam_env.so
237session required pam_limits.so
238session required pam_unix.so
239session required pam_loginuid.so
240session optional pam_keyinit.so force revoke
241session optional pam_systemd.so
242
243auth required pam_deny.so
244password required pam_deny.so
245
246# End /etc/pam.d/systemd-user</literal>
247EOF</userinput></screen>
248
249 <para>
250 At this point, you should reload the systemd daemon, and reenter
251 multi-user mode with the following commands (as the
252 <systemitem class="username">root</systemitem> user):
253 </para>
254
255<screen role="root"><userinput>systemctl daemon-reload
256systemctl start multi-user.target</userinput></screen>
257
258 <warning><para>If upgrading from a previous version of systemd and an
259 initrd is used for system boot, you should generate a new initrd before
260 rebooting the system.</para></warning>
261
262 </sect2>
263
264 <sect2 role="content">
265 <title>Contents</title>
266
267 <para>
268 A list of the installed files, along with their short
269 descriptions can be found at
270 <ulink url="&lfs-root;/chapter06/systemd.html#contents-systemd"/>.
271 </para>
272
273 <para>
274 Listed below are the newly installed libraries and directories
275 along with short descriptions.
276 </para>
277
278 <segmentedlist>
279 <segtitle>Installed Programs</segtitle>
280 <segtitle>Installed Libraries</segtitle>
281 <segtitle>Installed Directories</segtitle>
282
283 <seglistitem>
284 <seg>
285 None
286 </seg>
287 <seg>
288 pam_systemd.so
289 (in <filename class="directory">/lib/security</filename>)
290 </seg>
291 <seg>
292 None
293 </seg>
294 </seglistitem>
295 </segmentedlist>
296
297 <variablelist>
298 <bridgehead renderas="sect3">Short Descriptions</bridgehead>
299 <?dbfo list-presentation="list"?>
300 <?dbhtml list-presentation="table"?>
301
302 <varlistentry id="pam_systemd">
303 <term><filename class="libraryfile">pam_systemd.so</filename></term>
304 <listitem>
305 <para>
306 is a PAM module used to register user sessions with the
307 <application>systemd</application> login manager,
308 <command>systemd-logind</command>.
309 </para>
310 <indexterm zone="systemd pam_systemd">
311 <primary sortas="c-pam_systemd">pam_systemd.so</primary>
312 </indexterm>
313 </listitem>
314 </varlistentry>
315
316 </variablelist>
317
318 </sect2>
319
320</sect1>
Note: See TracBrowser for help on using the repository browser.