glfs/general/sysutils/systemd.xml
Douglas R. Reno 2ecacdddfc Tag systemd
mesa: Add libunwind as an optional external dependency.

git-svn-id: svn://svn.linuxfromscratch.org/BLFS/trunk/BOOK@22721 af4574ff-66df-0310-9fd7-8a98e5e911e0
2020-02-18 19:26:31 +00:00

336 lines
11 KiB
XML

<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
<!ENTITY % general-entities SYSTEM "../../general.ent">
%general-entities;
<!-- <!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 -->
<!ENTITY systemd-download-http "https://github.com/systemd/systemd/archive/v&systemd-version;/systemd-&systemd-version;.tar.gz">
<!ENTITY systemd-download-ftp " ">
<!ENTITY systemd-md5sum "413121fe918b252ae62310f6fc7c4b32">
<!ENTITY systemd-size "8.1 MB">
<!ENTITY systemd-buildsize "240 MB (with tests)">
<!ENTITY systemd-time "2.0 SBU (with tests)">
]>
<sect1 id="systemd" xreflabel="Systemd-&systemd-version;" revision="systemd">
<?dbhtml filename="systemd.html"?>
<sect1info>
<othername>$LastChangedBy$</othername>
<date>$Date$</date>
</sect1info>
<title>Systemd-&systemd-version;</title>
<!-- Whenever we switch back to stable backports, make sure to add the systemd-stable reference back. -->
<indexterm zone="systemd">
<primary sortas="a-systemd">systemd</primary>
</indexterm>
<sect2 role="package">
<title>Introduction to systemd</title>
<para>
While <application>systemd</application> was installed when
building LFS, there are many features provided by the package that
were not included in the initial installation because
<application>Linux-PAM</application> was not yet installed.
The <application>systemd</application> package needs to be
rebuilt to provide a working <command>systemd-logind</command> service,
which provides many additional features for dependent packages.
</para>
&lfs91_checked;
<bridgehead renderas="sect3">Package Information</bridgehead>
<itemizedlist spacing="compact">
<listitem>
<para>Download (HTTP): <ulink url="&systemd-download-http;"/></para>
</listitem>
<listitem>
<para>Download (FTP): <ulink url="&systemd-download-ftp;"/></para>
</listitem>
<listitem>
<para>Download MD5 sum: &systemd-md5sum;</para>
</listitem>
<listitem>
<para>Download size: &systemd-size;</para>
</listitem>
<listitem>
<para>Estimated disk space required: &systemd-buildsize;</para>
</listitem>
<listitem>
<para>Estimated build time: &systemd-time;</para>
</listitem>
</itemizedlist>
<bridgehead renderas="sect3">Additional Downloads</bridgehead>
<itemizedlist spacing="compact">
<listitem>
<para>
Required patch:
<ulink url="&patch-root;/systemd-&systemd-version;-seccomp_and_cpuaffinity_fix-1.patch"/>
</para>
</listitem>
</itemizedlist>
<bridgehead renderas="sect3">systemd Dependencies</bridgehead>
<bridgehead renderas="sect4">Required</bridgehead>
<para role="required">
<xref linkend="linux-pam"/>
</para>
<bridgehead renderas="sect4">Recommended Runtime Dependencies</bridgehead>
<para role="recommended">
<xref role="runtime" linkend="polkit"/>
</para>
<bridgehead renderas="sect4">Optional</bridgehead>
<para role="optional">
<xref linkend="curl"/>,
<xref linkend="cryptsetup"/>,
<xref linkend="git"/>,
<xref linkend="gnutls"/>,
<xref linkend="iptables"/>,
<xref linkend="libgcrypt"/>,
<xref linkend="libidn2"/>,
<xref linkend="libseccomp"/>,
<xref linkend="libxkbcommon"/>,
<xref linkend="make-ca"/>,
<xref linkend="pcre2"/>,
<xref linkend="qemu"/>,
<xref linkend="valgrind"/>,
<xref linkend="zsh"/> (for the zsh completions),
<ulink url="http://sourceforge.net/projects/gnu-efi/">gnu-efi</ulink>,
<ulink url="https://www.kernel.org/pub/linux/utils/kernel/kexec/">kexec-tools</ulink>,
<ulink url="https://www.gnu.org/software/libmicrohttpd/">libmicrohttpd</ulink>,
<ulink url="http://lz4.github.io/lz4/">lz4</ulink>,
<ulink url="http://fukuchi.org/works/qrencode/">qrencode</ulink>,
<ulink url="http://sourceforge.net/projects/linuxquota/">quota-tools</ulink> and
<ulink url="https://pypi.python.org/pypi/Sphinx">Sphinx</ulink>
</para>
<bridgehead renderas="sect4">Optional (to rebuild the manual pages)</bridgehead>
<para role="optional">
<xref linkend="DocBook"/>,
<xref linkend="docbook-xsl"/>,
<xref linkend="libxslt"/>, and
<xref linkend="lxml"/> (to build the index of systemd manual pages)
</para>
<para condition="html" role="usernotes">User Notes:
<ulink url="&blfs-wiki;/systemd"/>
</para>
</sect2>
<sect2 role="installation">
<title>Installation of systemd</title>
<!-- 243-244 is now supported, so let's comment this for now.
<warning><para>This version of systemd is incompatible with all previous
releases. The BLFS team does not recommend updating in place, and suggests
that you do a rebuild instead.</para></warning>
-->
<para>Apply a patch to fix problems with libseccomp-2.4.2+ and Linux-5.4+:</para>
<screen><userinput remap="pre">patch -Np1 -i ../systemd-&systemd-version;-seccomp_and_cpuaffinity_fix-1.patch</userinput></screen>
<!-- The above is only needed on systems with Linux 5.4+ and libseccomp-2.4.2+
This fix is due to syscall changes in libseccomp+Linux 5.4+.
The affected syscall is shmat(), which isn't implemented properly on
i686, and intermittently fails on x86_64. Also, there is a problem with
CPU Affinity + CGroups on Linux-5.4+ that causes issues with the
"test-execute" test. -->
<para>Remove an unneeded group,
<systemitem class="groupname">render</systemitem>, from the default udev
rules:</para>
<screen><userinput remap="pre">sed -i 's/GROUP="render", //' rules.d/50-udev-default.rules.in</userinput></screen>
<para>
Rebuild <application>systemd</application> by running the
following commands:
</para>
<screen><userinput>mkdir build &amp;&amp;
cd build &amp;&amp;
meson --prefix=/usr \
--sysconfdir=/etc \
--localstatedir=/var \
-Dblkid=true \
-Dbuildtype=release \
-Ddefault-dnssec=no \
-Dfirstboot=false \
-Dinstall-tests=false \
-Dldconfig=false \
-Dman=auto \
-Drootprefix= \
-Drootlibdir=/lib \
-Dsplit-usr=true \
-Dsysusers=false \
-Drpmmacrosdir=no \
-Db_lto=false \
.. &amp;&amp;
ninja</userinput></screen>
<note>
<para>
For the best test results, make sure you run the testsuite from
a system that is booted by the same
<application>systemd</application> version you are rebuilding.
</para>
</note>
<para>
To test the results, issue: <command>ninja test</command>. <!--One test,
<filename>udev-test</filename> (test 273) fails due to changes in
the Linux 5.3+ kernel. It does not affect the package's
functionality. NO LONGER APPLICABLE AS OF 244 -->
</para>
<warning>
<para>
Installing the package will overwrite all files installed by
<application>systemd</application> in LFS. It is critical that
nothing uses either <application>systemd</application> or
<application>Udev</application> libraries during the installation.
The best way to ensure that these libraries are not being used is to
run the installation in rescue mode. To switch to rescue mode,
run the following command as the
<systemitem class="username">root</systemitem> user (from a TTY):
</para>
<screen role="root"><userinput>systemctl start rescue.target</userinput></screen>
</warning>
<para>
Now, as the <systemitem class="username">root</systemitem> user:
</para>
<screen role="root"><userinput>ninja install</userinput></screen>
<!-- No longer needed as of systemd-244.
<para>
Remove a configuration file that causes some problems with PID files:
</para>
<screen role="root"><userinput>rm -fv /etc/sysctl.d/50-pid-max.conf</userinput></screen>
-->
</sect2>
<sect2 role="configuration">
<title>Configuring systemd</title>
<para>
The <filename>/etc/pam.d/system-session</filename> file needs to
be modified and a new file needs to be created in order for
<command>systemd-logind</command> to work correctly. Run the following
commands as the <systemitem class="username">root</systemitem> user:
</para>
<screen role="root"><userinput>cat &gt;&gt; /etc/pam.d/system-session &lt;&lt; "EOF"
<literal># Begin Systemd addition
session required pam_loginuid.so
session optional pam_systemd.so
# End Systemd addition</literal>
EOF
cat &gt; /etc/pam.d/systemd-user &lt;&lt; "EOF"
<literal># Begin /etc/pam.d/systemd-user
account required pam_access.so
account include system-account
session required pam_env.so
session required pam_limits.so
session required pam_unix.so
session required pam_loginuid.so
session optional pam_keyinit.so force revoke
session optional pam_systemd.so
auth required pam_deny.so
password required pam_deny.so
# End /etc/pam.d/systemd-user</literal>
EOF</userinput></screen>
<para>
At this point, you should reload the systemd daemon, and reenter
multi-user mode with the following commands (as the
<systemitem class="username">root</systemitem> user):
</para>
<screen role="root"><userinput>systemctl daemon-reload
systemctl start multi-user.target</userinput></screen>
<warning><para>If upgrading from a previous version of systemd and an
initrd is used for system boot, you should generate a new initrd before
rebooting the system.</para></warning>
</sect2>
<sect2 role="content">
<title>Contents</title>
<para>
A list of the installed files, along with their short
descriptions can be found at
<ulink url="&lfs-root;/chapter06/systemd.html#contents-systemd"/>.
</para>
<para>
Listed below are the newly installed libraries and directories
along with short descriptions.
</para>
<segmentedlist>
<segtitle>Installed Programs</segtitle>
<segtitle>Installed Libraries</segtitle>
<segtitle>Installed Directories</segtitle>
<seglistitem>
<seg>
None
</seg>
<seg>
pam_systemd.so
(in <filename class="directory">/lib/security</filename>)
</seg>
<seg>
None
</seg>
</seglistitem>
</segmentedlist>
<variablelist>
<bridgehead renderas="sect3">Short Descriptions</bridgehead>
<?dbfo list-presentation="list"?>
<?dbhtml list-presentation="table"?>
<varlistentry id="pam_systemd">
<term><filename class="libraryfile">pam_systemd.so</filename></term>
<listitem>
<para>
is a PAM module used to register user sessions with the
<application>systemd</application> login manager,
<command>systemd-logind</command>.
</para>
<indexterm zone="systemd pam_systemd">
<primary sortas="c-pam_systemd">pam_systemd.so</primary>
</indexterm>
</listitem>
</varlistentry>
</variablelist>
</sect2>
</sect1>