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