[d1ea8a45] | 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://www.freedesktop.org/software/systemd/">
|
---|
| 8 | <!ENTITY systemd-patch-download-http "http://www.linuxfromscratch.org/patches/downloads/systemd/">
|
---|
| 9 | ]>
|
---|
| 10 |
|
---|
| 11 | <sect1 id="systemd" xreflabel="Systemd">
|
---|
| 12 | <?dbhtml filename="systemd.html"?>
|
---|
| 13 |
|
---|
| 14 | <sect1info>
|
---|
| 15 | <othername>$LastChangedBy$</othername>
|
---|
| 16 | <date>$Date$</date>
|
---|
| 17 | </sect1info>
|
---|
| 18 |
|
---|
| 19 | <title>Systemd</title>
|
---|
| 20 |
|
---|
| 21 | <indexterm zone="systemd">
|
---|
| 22 | <primary sortas="a-systemd">systemd</primary>
|
---|
| 23 | </indexterm>
|
---|
| 24 |
|
---|
| 25 | <sect2 role="package">
|
---|
| 26 | <title>Introduction to systemd</title>
|
---|
| 27 |
|
---|
| 28 | <para>
|
---|
| 29 | Even though <application>systemd</application> was built in
|
---|
| 30 | LFS, there are some features provided by the package that
|
---|
| 31 | some BLFS packages need, but their dependencies didn't fit
|
---|
| 32 | into LFS.
|
---|
| 33 | </para>
|
---|
| 34 |
|
---|
| 35 | <para>
|
---|
[ac38e9dc] | 36 | The main reason why <application>systemd</application>
|
---|
| 37 | needs to be rebuilt is that some packages expect
|
---|
| 38 | working <command>systemd-logind</command> service
|
---|
| 39 | which requires a PAM module from the
|
---|
| 40 | <application>systemd</application> source that
|
---|
| 41 | couldn't be built in LFS.
|
---|
[d1ea8a45] | 42 | </para>
|
---|
| 43 |
|
---|
| 44 | <para>
|
---|
| 45 | Unlike other packages in BLFS, there is no set version of
|
---|
| 46 | <application>systemd</application> in this page's title and
|
---|
| 47 | no set version specified for download. Version updates to
|
---|
| 48 | <application>systemd</application> make it possible that the
|
---|
| 49 | user's system may have a <application>systemd</application>
|
---|
| 50 | version different from the one in the current LFS book.
|
---|
| 51 | Therefore, users should use the version of
|
---|
| 52 | <application>systemd</application> that is currently
|
---|
| 53 | installed on their system.
|
---|
| 54 | </para>
|
---|
| 55 |
|
---|
[7274e6c] | 56 | <para>
|
---|
| 57 | This package is known to build and work properly using an
|
---|
[ac38e9dc] | 58 | LFS-7.7 systemd platform using systemd-221 source.
|
---|
[7274e6c] | 59 | </para>
|
---|
| 60 |
|
---|
[d1ea8a45] | 61 | <bridgehead renderas="sect3">Package Information</bridgehead>
|
---|
| 62 | <itemizedlist spacing="compact">
|
---|
| 63 | <listitem>
|
---|
| 64 | <para>Systemd Download (HTTP): <ulink url="&systemd-download-http;"/></para>
|
---|
| 65 | </listitem>
|
---|
| 66 | <listitem>
|
---|
| 67 | <para>Systemd Patch Download (HTTP): <ulink url="&systemd-patch-download-http;"/></para>
|
---|
| 68 | </listitem>
|
---|
| 69 | </itemizedlist>
|
---|
| 70 |
|
---|
| 71 | <para>
|
---|
| 72 | Make sure you download the "compat" patch whose version matches
|
---|
| 73 | the <application>systemd</application> version you are building.
|
---|
| 74 | </para>
|
---|
| 75 |
|
---|
| 76 | <note>
|
---|
| 77 | <para>
|
---|
| 78 | If you are unsure which version needs to be downloaded, issue
|
---|
| 79 | <command>systemctl --version</command> in order to find out.
|
---|
| 80 | Some of the commands below might need the version information.
|
---|
| 81 | Issue the following command to store the
|
---|
| 82 | <application>systemd</application> version number into an
|
---|
| 83 | environment variable:
|
---|
| 84 | </para>
|
---|
| 85 |
|
---|
| 86 | <screen><userinput>export SYSTEMD_VERSION=$(systemctl --version | head -n1 | awk '{print $2}')</userinput></screen>
|
---|
| 87 | </note>
|
---|
| 88 |
|
---|
| 89 | <bridgehead renderas="sect3">systemd Dependencies</bridgehead>
|
---|
| 90 |
|
---|
[ac38e9dc] | 91 | <bridgehead renderas="sect4">Required</bridgehead>
|
---|
[d1ea8a45] | 92 | <para role="required">
|
---|
| 93 | <xref linkend="linux-pam"/>
|
---|
| 94 | </para>
|
---|
| 95 |
|
---|
| 96 | <bridgehead renderas="sect4">Recommended Runtime Dependency</bridgehead>
|
---|
| 97 | <para role="recommended">
|
---|
| 98 | <xref linkend="polkit"/>
|
---|
| 99 | </para>
|
---|
| 100 |
|
---|
| 101 | <bridgehead renderas="sect4">Optional</bridgehead>
|
---|
| 102 | <para role="optional">
|
---|
[ac38e9dc] | 103 | <xref linkend="cacerts"/>,
|
---|
[d1ea8a45] | 104 | <xref linkend="curl"/>,
|
---|
| 105 | <xref linkend="elfutils"/>,
|
---|
| 106 | <xref linkend="gnutls"/>,
|
---|
[ac38e9dc] | 107 | <xref linkend="iptables"/>,
|
---|
[d1ea8a45] | 108 | <xref linkend="libgcrypt"/>,
|
---|
[b13775d] | 109 | <xref linkend="libidn"/>,
|
---|
[ac38e9dc] | 110 | <xref linkend="libxkbcommon"/>,
|
---|
| 111 | <xref linkend="python2"/> or
|
---|
[d1ea8a45] | 112 | <xref linkend="python3"/>,
|
---|
[ac38e9dc] | 113 | <xref linkend="qemu"/>,
|
---|
[b13775d] | 114 | <xref linkend="valgrind"/>,
|
---|
[ac38e9dc] | 115 | <ulink url="https://www.kernel.org/pub/linux/utils/cryptsetup/">cryptsetup</ulink>,
|
---|
| 116 | <ulink url="http://sourceforge.net/projects/gnu-efi/">gnu-efi</ulink>,
|
---|
| 117 | <ulink url="https://www.kernel.org/pub/linux/utils/kernel/kexec/">kexec-tools</ulink>,
|
---|
[d1ea8a45] | 118 | <ulink url="https://www.gnu.org/software/libmicrohttpd/">libmicrohttpd</ulink>,
|
---|
[b13775d] | 119 | <ulink url="http://sourceforge.net/projects/libseccomp/">libseccomp</ulink>,
|
---|
[ac38e9dc] | 120 | <ulink url="http://lxml.de/">lxml</ulink> (Python Module),
|
---|
| 121 | <ulink url="https://code.google.com/p/lz4/">lz4</ulink>,
|
---|
| 122 | <ulink url="http://fukuchi.org/works/qrencode/">qrencode</ulink>,
|
---|
| 123 | <ulink url="http://sourceforge.net/projects/linuxquota/">quota-tools</ulink> and
|
---|
| 124 | <ulink url="https://pypi.python.org/pypi/Sphinx">Sphinx</ulink>
|
---|
[d1ea8a45] | 125 | </para>
|
---|
| 126 |
|
---|
| 127 | <note>
|
---|
| 128 | <para>
|
---|
| 129 | In order to build the <application>systemd</application>
|
---|
| 130 | <application>Python</application> module, lxml package
|
---|
| 131 | needs to be installed for the corresponding
|
---|
| 132 | <application>Python</application> version (2 or 3).
|
---|
| 133 | Note that <command>configure</command> defaults to
|
---|
| 134 | <application>Python 2</application>. In order to build
|
---|
| 135 | the module for <application>Python 3</application>,
|
---|
| 136 | make sure you pass the <envar>PYTHON=python3</envar>
|
---|
| 137 | environment variable to the <command>configure</command>
|
---|
| 138 | command below.
|
---|
| 139 | </para>
|
---|
| 140 | </note>
|
---|
| 141 |
|
---|
[ac38e9dc] | 142 | <bridgehead renderas="sect4">Optional (to rebuild the manual pages)</bridgehead>
|
---|
[d1ea8a45] | 143 | <para role="optional">
|
---|
[ac38e9dc] | 144 | <xref linkend="DocBook"/>,
|
---|
| 145 | <xref linkend="docbook-xsl"/> and
|
---|
| 146 | <xref linkend="libxslt"/>
|
---|
[d1ea8a45] | 147 | </para>
|
---|
| 148 |
|
---|
| 149 | <para condition="html" role="usernotes">User Notes:
|
---|
| 150 | <ulink url="&blfs-wiki;/systemd"/>
|
---|
| 151 | </para>
|
---|
| 152 | </sect2>
|
---|
| 153 |
|
---|
| 154 | <sect2 role="installation">
|
---|
| 155 | <title>Installation of systemd</title>
|
---|
| 156 |
|
---|
| 157 | <para>
|
---|
| 158 | First, apply the required patch:
|
---|
| 159 | </para>
|
---|
| 160 |
|
---|
| 161 | <screen><userinput>patch -Np1 -i ../systemd-${SYSTEMD_VERSION}-compat-1.patch</userinput></screen>
|
---|
| 162 |
|
---|
[ac38e9dc] | 163 | <para>
|
---|
| 164 | Additionally, apply any patch that is also applied in LFS.
|
---|
| 165 | </para>
|
---|
| 166 |
|
---|
| 167 | <para>
|
---|
| 168 | Disable two tests that always fail:
|
---|
| 169 | </para>
|
---|
| 170 |
|
---|
| 171 | <screen><userinput>sed -e 's:test/udev-test.pl ::g' \
|
---|
| 172 | -e 's:test-copy$(EXEEXT) ::g' \
|
---|
| 173 | -i Makefile.in</userinput></screen>
|
---|
| 174 |
|
---|
[d1ea8a45] | 175 | <para>
|
---|
| 176 | Rebuild <application>systemd</application> by running the
|
---|
| 177 | following commands:
|
---|
| 178 | </para>
|
---|
| 179 |
|
---|
[b13775d] | 180 | <screen><userinput>cc_cv_CFLAGS__flto=no \
|
---|
| 181 | ./configure --prefix=/usr \
|
---|
[d1ea8a45] | 182 | --sysconfdir=/etc \
|
---|
| 183 | --localstatedir=/var \
|
---|
| 184 | --with-rootprefix= \
|
---|
| 185 | --with-rootlibdir=/lib \
|
---|
| 186 | --enable-split-usr \
|
---|
[b13775d] | 187 | --disable-firstboot \
|
---|
| 188 | --disable-ldconfig \
|
---|
| 189 | --disable-sysusers \
|
---|
[ac38e9dc] | 190 | --without-python \
|
---|
[d1ea8a45] | 191 | --docdir=/usr/share/doc/systemd-${SYSTEMD_VERSION} &&
|
---|
| 192 | make</userinput></screen>
|
---|
| 193 |
|
---|
| 194 | <note>
|
---|
| 195 | <para>
|
---|
| 196 | For the best results, make sure you run the testsuite from
|
---|
| 197 | a system that is booted by the same
|
---|
| 198 | <application>systemd</application> version you are rebuilding.
|
---|
| 199 | </para>
|
---|
| 200 | </note>
|
---|
| 201 |
|
---|
| 202 | <para>
|
---|
| 203 | To test the results, issue: <command>make -k check</command>.
|
---|
| 204 | </para>
|
---|
| 205 |
|
---|
| 206 | <warning>
|
---|
| 207 | <para>
|
---|
| 208 | Installing the package will override all files installed by
|
---|
| 209 | <application>systemd</application> in LFS. It is critical that
|
---|
| 210 | nothing uses either <application>systemd</application> or
|
---|
| 211 | <application>Udev</application> libraries or programs during
|
---|
| 212 | the installation phrase. Best way to achieve that is to do the
|
---|
| 213 | installation in the rescue mode. To switch to the rescue mode,
|
---|
| 214 | issue the following command as the
|
---|
[c32ea611] | 215 | <systemitem class="username">root</systemitem> user from a TTY:
|
---|
[d1ea8a45] | 216 | </para>
|
---|
| 217 |
|
---|
| 218 | <screen role="root"><userinput>systemctl start rescue.target</userinput></screen>
|
---|
| 219 | </warning>
|
---|
| 220 |
|
---|
| 221 | <para>
|
---|
[b13775d] | 222 | Now, as the <systemitem class="username">root</systemitem> user:
|
---|
| 223 | </para>
|
---|
[d1ea8a45] | 224 |
|
---|
| 225 | <screen role="root"><userinput>make install</userinput></screen>
|
---|
| 226 |
|
---|
| 227 | <para>
|
---|
[b13775d] | 228 | Move NSS libraries to <filename class="directory">/lib</filename>
|
---|
| 229 | by running the following command as the <systemitem
|
---|
[d1ea8a45] | 230 | class="username">root</systemitem> user:
|
---|
| 231 | </para>
|
---|
| 232 |
|
---|
[b13775d] | 233 | <screen role="root"><userinput>mv -v /usr/lib/libnss_{myhostname,mymachines,resolve}.so.2 /lib</userinput></screen>
|
---|
[d1ea8a45] | 234 |
|
---|
| 235 | <para>
|
---|
[b13775d] | 236 | Remove an unnecessary directory by running the following command
|
---|
| 237 | as the <systemitem class="username">root</systemitem> user:
|
---|
[d1ea8a45] | 238 | </para>
|
---|
| 239 |
|
---|
| 240 | <screen role="root"><userinput>rm -rfv /usr/lib/rpm</userinput></screen>
|
---|
| 241 |
|
---|
| 242 | <para>
|
---|
[b13775d] | 243 | Remove a reference to a non-existent group by running the following
|
---|
| 244 | command as the <systemitem class="username">root</systemitem> user:
|
---|
[d1ea8a45] | 245 | </para>
|
---|
| 246 |
|
---|
| 247 | <screen role="root"><userinput>sed -i "s:0775 root lock:0755 root root:g" /usr/lib/tmpfiles.d/legacy.conf</userinput></screen>
|
---|
| 248 |
|
---|
| 249 | </sect2>
|
---|
| 250 |
|
---|
| 251 | <sect2 role="configuration">
|
---|
| 252 | <title>Configuring systemd</title>
|
---|
| 253 |
|
---|
| 254 | <para>
|
---|
[ac38e9dc] | 255 | The <filename>/etc/pam.d/system-sesion</filename> file needs to
|
---|
[d1ea8a45] | 256 | be modified and a new file needs to be created in order for
|
---|
| 257 | <command>systemd-logind</command> to work correctly. To accomplish
|
---|
| 258 | that, run the following commands as the <systemitem
|
---|
| 259 | class="username">root</systemitem> user:
|
---|
| 260 | </para>
|
---|
| 261 |
|
---|
[ac38e9dc] | 262 | <screen role="root"><userinput>cat >> /etc/pam.d/system-session << "EOF" &&
|
---|
[d1ea8a45] | 263 | <literal># Begin Systemd addition
|
---|
| 264 |
|
---|
| 265 | session required pam_loginuid.so
|
---|
[ac38e9dc] | 266 | session optional pam_systemd.so
|
---|
[d1ea8a45] | 267 |
|
---|
| 268 | # End Systemd addition</literal>
|
---|
| 269 | EOF
|
---|
| 270 |
|
---|
| 271 | cat > /etc/pam.d/systemd-user << "EOF"
|
---|
| 272 | <literal># Begin /etc/pam.d/systemd-user
|
---|
| 273 |
|
---|
| 274 | account required pam_access.so
|
---|
| 275 | account include system-account
|
---|
| 276 |
|
---|
| 277 | session required pam_env.so
|
---|
| 278 | session required pam_limits.so
|
---|
| 279 | session include system-session
|
---|
| 280 |
|
---|
| 281 | auth required pam_deny.so
|
---|
| 282 | password required pam_deny.so
|
---|
| 283 |
|
---|
| 284 | # End /etc/pam.d/systemd-user</literal>
|
---|
| 285 | EOF</userinput></screen>
|
---|
| 286 |
|
---|
| 287 | <para>
|
---|
| 288 | At this point it would be a nice idea to reboot to
|
---|
[f2d55c92] | 289 | test if the reinstallation was successful.
|
---|
[d1ea8a45] | 290 | </para>
|
---|
| 291 |
|
---|
| 292 | </sect2>
|
---|
| 293 |
|
---|
| 294 | <sect2 role="content">
|
---|
| 295 | <title>Contents</title>
|
---|
| 296 |
|
---|
| 297 | <para>
|
---|
| 298 | A list of the installed files, along with their short
|
---|
| 299 | descriptions can be found at
|
---|
[035e5d56] | 300 | <ulink url="&lfs-root;/chapter06/systemd.html#contents-systemd"/>.
|
---|
[d1ea8a45] | 301 | </para>
|
---|
| 302 |
|
---|
| 303 | <para>
|
---|
| 304 | Below are listed newly installed libraries and directories
|
---|
| 305 | along with short descriptions.
|
---|
| 306 | </para>
|
---|
| 307 |
|
---|
| 308 | <segmentedlist>
|
---|
| 309 | <segtitle>Installed Programs</segtitle>
|
---|
| 310 | <segtitle>Installed Libraries</segtitle>
|
---|
| 311 | <segtitle>Installed Directories</segtitle>
|
---|
| 312 |
|
---|
| 313 | <seglistitem>
|
---|
| 314 | <seg>
|
---|
| 315 | None
|
---|
| 316 | </seg>
|
---|
| 317 | <seg>
|
---|
[ac38e9dc] | 318 | pam_systemd.so
|
---|
[d1ea8a45] | 319 | (in <filename class="directory">/lib/security</filename>)
|
---|
| 320 | </seg>
|
---|
| 321 | <seg>
|
---|
[ac38e9dc] | 322 | None
|
---|
[d1ea8a45] | 323 | </seg>
|
---|
| 324 | </seglistitem>
|
---|
| 325 | </segmentedlist>
|
---|
| 326 |
|
---|
| 327 | <variablelist>
|
---|
| 328 | <bridgehead renderas="sect3">Short Descriptions</bridgehead>
|
---|
| 329 | <?dbfo list-presentation="list"?>
|
---|
| 330 | <?dbhtml list-presentation="table"?>
|
---|
| 331 |
|
---|
| 332 | <varlistentry id="pam_systemd">
|
---|
| 333 | <term><filename class="libraryfile">pam_systemd.so</filename></term>
|
---|
| 334 | <listitem>
|
---|
| 335 | <para>
|
---|
| 336 | is a PAM module used to register user sessions with the
|
---|
| 337 | <application>systemd</application> login manager,
|
---|
| 338 | <command>systemd-logind</command>.
|
---|
| 339 | </para>
|
---|
| 340 | <indexterm zone="systemd pam_systemd">
|
---|
| 341 | <primary sortas="c-pam_systemd">pam_systemd.so</primary>
|
---|
| 342 | </indexterm>
|
---|
| 343 | </listitem>
|
---|
| 344 | </varlistentry>
|
---|
| 345 |
|
---|
| 346 | </variablelist>
|
---|
| 347 |
|
---|
| 348 | </sect2>
|
---|
| 349 |
|
---|
| 350 | </sect1>
|
---|