[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 " ">
|
---|
[fbb96eb6] | 10 | <!ENTITY systemd-md5sum "413121fe918b252ae62310f6fc7c4b32">
|
---|
| 11 | <!ENTITY systemd-size "8.1 MB">
|
---|
| 12 | <!ENTITY systemd-buildsize "240 MB (with tests)">
|
---|
| 13 | <!ENTITY systemd-time "2.0 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 |
|
---|
[0260f4b] | 45 | &lfs90_checked;
|
---|
[f852e706] | 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>
|
---|
[fbb96eb6] | 68 |
|
---|
[b5d17476] | 69 | <bridgehead renderas="sect3">Additional Downloads</bridgehead>
|
---|
| 70 | <itemizedlist spacing="compact">
|
---|
| 71 | <listitem>
|
---|
| 72 | <para>
|
---|
| 73 | Required patch:
|
---|
[b29b596] | 74 | <ulink url="&patch-root;/systemd-&systemd-version;-seccomp_and_cpuaffinity_fix-1.patch"/>
|
---|
[b5d17476] | 75 | </para>
|
---|
| 76 | </listitem>
|
---|
| 77 | </itemizedlist>
|
---|
[b29b596] | 78 |
|
---|
[f852e706] | 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 |
|
---|
[c7ab75e8] | 86 | <bridgehead renderas="sect4">Recommended Runtime Dependencies</bridgehead>
|
---|
[f852e706] | 87 | <para role="recommended">
|
---|
[60ddbaf] | 88 | <xref role="runtime" linkend="polkit"/>
|
---|
[f852e706] | 89 | </para>
|
---|
| 90 |
|
---|
| 91 | <bridgehead renderas="sect4">Optional</bridgehead>
|
---|
| 92 | <para role="optional">
|
---|
| 93 | <xref linkend="curl"/>,
|
---|
[b1be08a] | 94 | <xref linkend="cryptsetup"/>,
|
---|
[5fff3896] | 95 | <xref linkend="git"/>,
|
---|
[f852e706] | 96 | <xref linkend="gnutls"/>,
|
---|
| 97 | <xref linkend="iptables"/>,
|
---|
| 98 | <xref linkend="libgcrypt"/>,
|
---|
[531f138] | 99 | <xref linkend="libidn2"/>,
|
---|
[11f3b7e] | 100 | <xref linkend="libseccomp"/>,
|
---|
[f852e706] | 101 | <xref linkend="libxkbcommon"/>,
|
---|
[b1be08a] | 102 | <xref linkend="make-ca"/>,
|
---|
[ebb31dbd] | 103 | <xref linkend="pcre2"/>,
|
---|
[f852e706] | 104 | <xref linkend="qemu"/>,
|
---|
| 105 | <xref linkend="valgrind"/>,
|
---|
[7c99c52] | 106 | <xref linkend="zsh"/> (for the zsh completions),
|
---|
[f852e706] | 107 | <ulink url="http://sourceforge.net/projects/gnu-efi/">gnu-efi</ulink>,
|
---|
| 108 | <ulink url="https://www.kernel.org/pub/linux/utils/kernel/kexec/">kexec-tools</ulink>,
|
---|
| 109 | <ulink url="https://www.gnu.org/software/libmicrohttpd/">libmicrohttpd</ulink>,
|
---|
[331a2b7] | 110 | <ulink url="http://lz4.github.io/lz4/">lz4</ulink>,
|
---|
[f852e706] | 111 | <ulink url="http://fukuchi.org/works/qrencode/">qrencode</ulink>,
|
---|
| 112 | <ulink url="http://sourceforge.net/projects/linuxquota/">quota-tools</ulink> and
|
---|
| 113 | <ulink url="https://pypi.python.org/pypi/Sphinx">Sphinx</ulink>
|
---|
| 114 | </para>
|
---|
| 115 |
|
---|
| 116 | <bridgehead renderas="sect4">Optional (to rebuild the manual pages)</bridgehead>
|
---|
| 117 | <para role="optional">
|
---|
| 118 | <xref linkend="DocBook"/>,
|
---|
[6f8d4ed] | 119 | <xref linkend="docbook-xsl"/>,
|
---|
| 120 | <xref linkend="libxslt"/>, and
|
---|
| 121 | <xref linkend="lxml"/> (to build the index of systemd manual pages)
|
---|
[f852e706] | 122 | </para>
|
---|
| 123 |
|
---|
| 124 | <para condition="html" role="usernotes">User Notes:
|
---|
| 125 | <ulink url="&blfs-wiki;/systemd"/>
|
---|
| 126 | </para>
|
---|
| 127 | </sect2>
|
---|
| 128 |
|
---|
| 129 | <sect2 role="installation">
|
---|
| 130 | <title>Installation of systemd</title>
|
---|
[fbb96eb6] | 131 | <!-- 243-244 is now supported, so let's comment this for now.
|
---|
[0dccf0ff] | 132 | <warning><para>This version of systemd is incompatible with all previous
|
---|
| 133 | releases. The BLFS team does not recommend updating in place, and suggests
|
---|
| 134 | that you do a rebuild instead.</para></warning>
|
---|
[fbb96eb6] | 135 | -->
|
---|
[93caa46] | 136 |
|
---|
[b29b596] | 137 | <para>Apply a patch to fix problems with libseccomp-2.4.2+ and Linux-5.4+:</para>
|
---|
[93caa46] | 138 |
|
---|
[b29b596] | 139 | <screen><userinput remap="pre">patch -Np1 -i ../systemd-&systemd-version;-seccomp_and_cpuaffinity_fix-1.patch</userinput></screen>
|
---|
| 140 |
|
---|
| 141 | <!-- The above is only needed on systems with Linux 5.4+ and libseccomp-2.4.2+
|
---|
| 142 | This fix is due to syscall changes in libseccomp+Linux 5.4+.
|
---|
| 143 | The affected syscall is shmat(), which isn't implemented properly on
|
---|
| 144 | i686, and intermittently fails on x86_64. Also, there is a problem with
|
---|
| 145 | CPU Affinity + CGroups on Linux-5.4+ that causes issues with the
|
---|
| 146 | "test-execute" test. -->
|
---|
[93caa46] | 147 |
|
---|
[b4e1b81] | 148 | <para>Remove an unneeded group,
|
---|
| 149 | <systemitem class="groupname">render</systemitem>, from the default udev
|
---|
| 150 | rules:</para>
|
---|
| 151 |
|
---|
[fbb96eb6] | 152 | <screen><userinput remap="pre">sed -i 's/GROUP="render", //' rules.d/50-udev-default.rules.in</userinput></screen>
|
---|
[b4e1b81] | 153 |
|
---|
[f852e706] | 154 | <para>
|
---|
| 155 | Rebuild <application>systemd</application> by running the
|
---|
| 156 | following commands:
|
---|
| 157 | </para>
|
---|
| 158 |
|
---|
[e1a8598d] | 159 | <screen><userinput>mkdir build &&
|
---|
| 160 | cd build &&
|
---|
| 161 |
|
---|
| 162 | meson --prefix=/usr \
|
---|
| 163 | --sysconfdir=/etc \
|
---|
| 164 | --localstatedir=/var \
|
---|
| 165 | -Dblkid=true \
|
---|
| 166 | -Dbuildtype=release \
|
---|
| 167 | -Ddefault-dnssec=no \
|
---|
| 168 | -Dfirstboot=false \
|
---|
| 169 | -Dinstall-tests=false \
|
---|
| 170 | -Dldconfig=false \
|
---|
[57feeb5] | 171 | -Dman=auto \
|
---|
[e1a8598d] | 172 | -Drootprefix= \
|
---|
| 173 | -Drootlibdir=/lib \
|
---|
| 174 | -Dsplit-usr=true \
|
---|
| 175 | -Dsysusers=false \
|
---|
[1dbb694f] | 176 | -Drpmmacrosdir=no \
|
---|
[e1a8598d] | 177 | -Db_lto=false \
|
---|
| 178 | .. &&
|
---|
| 179 |
|
---|
[71becb2] | 180 | ninja</userinput></screen>
|
---|
[f852e706] | 181 |
|
---|
| 182 | <note>
|
---|
| 183 | <para>
|
---|
[e1a8598d] | 184 | For the best test results, make sure you run the testsuite from
|
---|
[f852e706] | 185 | a system that is booted by the same
|
---|
| 186 | <application>systemd</application> version you are rebuilding.
|
---|
| 187 | </para>
|
---|
| 188 | </note>
|
---|
| 189 |
|
---|
| 190 | <para>
|
---|
[fbb96eb6] | 191 | To test the results, issue: <command>ninja test</command>. <!--One test,
|
---|
[0dccf0ff] | 192 | <filename>udev-test</filename> (test 273) fails due to changes in
|
---|
| 193 | the Linux 5.3+ kernel. It does not affect the package's
|
---|
[fbb96eb6] | 194 | functionality. NO LONGER APPLICABLE AS OF 244 -->
|
---|
[f852e706] | 195 | </para>
|
---|
| 196 |
|
---|
| 197 | <warning>
|
---|
| 198 | <para>
|
---|
| 199 | Installing the package will overwrite all files installed by
|
---|
| 200 | <application>systemd</application> in LFS. It is critical that
|
---|
| 201 | nothing uses either <application>systemd</application> or
|
---|
| 202 | <application>Udev</application> libraries during the installation.
|
---|
| 203 | The best way to ensure that these libraries are not being used is to
|
---|
| 204 | run the installation in rescue mode. To switch to rescue mode,
|
---|
| 205 | run the following command as the
|
---|
| 206 | <systemitem class="username">root</systemitem> user (from a TTY):
|
---|
| 207 | </para>
|
---|
| 208 |
|
---|
| 209 | <screen role="root"><userinput>systemctl start rescue.target</userinput></screen>
|
---|
| 210 | </warning>
|
---|
| 211 |
|
---|
| 212 | <para>
|
---|
| 213 | Now, as the <systemitem class="username">root</systemitem> user:
|
---|
| 214 | </para>
|
---|
| 215 |
|
---|
[71becb2] | 216 | <screen role="root"><userinput>ninja install</userinput></screen>
|
---|
[f852e706] | 217 |
|
---|
[0dccf0ff] | 218 | <para>
|
---|
| 219 | Remove a configuration file that causes some problems with PID files:
|
---|
| 220 | </para>
|
---|
| 221 |
|
---|
| 222 | <screen role="root"><userinput>rm -fv /etc/sysctl.d/50-pid-max.conf</userinput></screen>
|
---|
| 223 |
|
---|
[f852e706] | 224 | </sect2>
|
---|
| 225 |
|
---|
| 226 | <sect2 role="configuration">
|
---|
| 227 | <title>Configuring systemd</title>
|
---|
| 228 |
|
---|
| 229 | <para>
|
---|
[325d88d6] | 230 | The <filename>/etc/pam.d/system-session</filename> file needs to
|
---|
[f852e706] | 231 | be modified and a new file needs to be created in order for
|
---|
| 232 | <command>systemd-logind</command> to work correctly. Run the following
|
---|
| 233 | commands as the <systemitem class="username">root</systemitem> user:
|
---|
| 234 | </para>
|
---|
| 235 |
|
---|
| 236 | <screen role="root"><userinput>cat >> /etc/pam.d/system-session << "EOF"
|
---|
| 237 | <literal># Begin Systemd addition
|
---|
| 238 |
|
---|
[d267a13] | 239 | session required pam_loginuid.so
|
---|
| 240 | session optional pam_systemd.so
|
---|
[f852e706] | 241 |
|
---|
| 242 | # End Systemd addition</literal>
|
---|
| 243 | EOF
|
---|
| 244 |
|
---|
| 245 | cat > /etc/pam.d/systemd-user << "EOF"
|
---|
| 246 | <literal># Begin /etc/pam.d/systemd-user
|
---|
| 247 |
|
---|
[d267a13] | 248 | account required pam_access.so
|
---|
| 249 | account include system-account
|
---|
[f852e706] | 250 |
|
---|
[d267a13] | 251 | session required pam_env.so
|
---|
| 252 | session required pam_limits.so
|
---|
| 253 | session required pam_unix.so
|
---|
| 254 | session required pam_loginuid.so
|
---|
| 255 | session optional pam_keyinit.so force revoke
|
---|
| 256 | session optional pam_systemd.so
|
---|
[f852e706] | 257 |
|
---|
[d267a13] | 258 | auth required pam_deny.so
|
---|
| 259 | password required pam_deny.so
|
---|
[f852e706] | 260 |
|
---|
| 261 | # End /etc/pam.d/systemd-user</literal>
|
---|
| 262 | EOF</userinput></screen>
|
---|
| 263 |
|
---|
| 264 | <para>
|
---|
| 265 | At this point, you should reload the systemd daemon, and reenter
|
---|
| 266 | multi-user mode with the following commands (as the
|
---|
| 267 | <systemitem class="username">root</systemitem> user):
|
---|
| 268 | </para>
|
---|
| 269 |
|
---|
| 270 | <screen role="root"><userinput>systemctl daemon-reload
|
---|
| 271 | systemctl start multi-user.target</userinput></screen>
|
---|
| 272 |
|
---|
| 273 | <warning><para>If upgrading from a previous version of systemd and an
|
---|
| 274 | initrd is used for system boot, you should generate a new initrd before
|
---|
| 275 | rebooting the system.</para></warning>
|
---|
| 276 |
|
---|
| 277 | </sect2>
|
---|
| 278 |
|
---|
| 279 | <sect2 role="content">
|
---|
| 280 | <title>Contents</title>
|
---|
| 281 |
|
---|
| 282 | <para>
|
---|
| 283 | A list of the installed files, along with their short
|
---|
| 284 | descriptions can be found at
|
---|
| 285 | <ulink url="&lfs-root;/chapter06/systemd.html#contents-systemd"/>.
|
---|
| 286 | </para>
|
---|
| 287 |
|
---|
| 288 | <para>
|
---|
| 289 | Listed below are the newly installed libraries and directories
|
---|
| 290 | along with short descriptions.
|
---|
| 291 | </para>
|
---|
| 292 |
|
---|
| 293 | <segmentedlist>
|
---|
| 294 | <segtitle>Installed Programs</segtitle>
|
---|
| 295 | <segtitle>Installed Libraries</segtitle>
|
---|
| 296 | <segtitle>Installed Directories</segtitle>
|
---|
| 297 |
|
---|
| 298 | <seglistitem>
|
---|
| 299 | <seg>
|
---|
| 300 | None
|
---|
| 301 | </seg>
|
---|
| 302 | <seg>
|
---|
| 303 | pam_systemd.so
|
---|
| 304 | (in <filename class="directory">/lib/security</filename>)
|
---|
| 305 | </seg>
|
---|
| 306 | <seg>
|
---|
| 307 | None
|
---|
| 308 | </seg>
|
---|
| 309 | </seglistitem>
|
---|
| 310 | </segmentedlist>
|
---|
| 311 |
|
---|
| 312 | <variablelist>
|
---|
| 313 | <bridgehead renderas="sect3">Short Descriptions</bridgehead>
|
---|
| 314 | <?dbfo list-presentation="list"?>
|
---|
| 315 | <?dbhtml list-presentation="table"?>
|
---|
| 316 |
|
---|
| 317 | <varlistentry id="pam_systemd">
|
---|
| 318 | <term><filename class="libraryfile">pam_systemd.so</filename></term>
|
---|
| 319 | <listitem>
|
---|
| 320 | <para>
|
---|
| 321 | is a PAM module used to register user sessions with the
|
---|
| 322 | <application>systemd</application> login manager,
|
---|
| 323 | <command>systemd-logind</command>.
|
---|
| 324 | </para>
|
---|
| 325 | <indexterm zone="systemd pam_systemd">
|
---|
| 326 | <primary sortas="c-pam_systemd">pam_systemd.so</primary>
|
---|
| 327 | </indexterm>
|
---|
| 328 | </listitem>
|
---|
| 329 | </varlistentry>
|
---|
| 330 |
|
---|
| 331 | </variablelist>
|
---|
| 332 |
|
---|
| 333 | </sect2>
|
---|
| 334 |
|
---|
| 335 | </sect1>
|
---|