source: general/sysutils/systemd.xml.next@ 75a38d0

systemd-11177
Last change on this file since 75a38d0 was 75a38d0, checked in by Krejzi <krejzi@…>, 10 years ago

Commit first draft of systemd instructions for systemd-216.

git-svn-id: svn://svn.linuxfromscratch.org/BLFS/branches/systemd@13966 af4574ff-66df-0310-9fd7-8a98e5e911e0

  • Property mode set to 100644
File size: 11.7 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://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="libidn"/>,
112 <xref linkend="python3"/>,
113 <ulink url="https://code.google.com/p/cryptsetup/">cryptsetup</ulink>,
114 <ulink url="https://www.gnu.org/software/libmicrohttpd/">libmicrohttpd</ulink>,
115 <ulink url="http://fukuchi.org/works/qrencode/">libqrencode</ulink>,
116 <ulink url="http://sourceforge.net/projects/libseccomp/">libseccomp</ulink>,
117 <ulink url="http://lxml.de/">lxml</ulink> (Python Module), and
118 <ulink url="https://code.google.com/p/lz4/">lz4</ulink>
119 </para>
120
121 <note>
122 <para>
123 In order to build the <application>systemd</application>
124 <application>Python</application> module, lxml package
125 needs to be installed for the corresponding
126 <application>Python</application> version (2 or 3).
127 Note that <command>configure</command> defaults to
128 <application>Python 2</application>. In order to build
129 the module for <application>Python 3</application>,
130 make sure you pass the <envar>PYTHON=python3</envar>
131 environment variable to the <command>configure</command>
132 command below.
133 </para>
134 </note>
135
136 <bridgehead renderas="sect4">Optional (for rebuilding manual pages)</bridgehead>
137 <para role="optional">
138 <xref linkend="libxslt"/>,
139 <xref linkend="DocBook"/>, and
140 <xref linkend="docbook-xsl"/>
141 </para>
142
143 <para condition="html" role="usernotes">User Notes:
144 <ulink url="&blfs-wiki;/systemd"/>
145 </para>
146 </sect2>
147
148 <sect2 role="installation">
149 <title>Installation of systemd</title>
150
151 <para>
152 First, apply the required patch:
153 </para>
154
155<screen><userinput>patch -Np1 -i ../systemd-${SYSTEMD_VERSION}-compat-1.patch</userinput></screen>
156
157 <para>
158 Rebuild <application>systemd</application> by running the
159 following commands:
160 </para>
161
162<screen><userinput>cc_cv_CFLAGS__flto=no \
163./configure --prefix=/usr \
164 --sysconfdir=/etc \
165 --localstatedir=/var \
166 --with-rootprefix= \
167 --with-rootlibdir=/lib \
168 --enable-split-usr \
169 --disable-ldconfig \
170 --docdir=/usr/share/doc/systemd-${SYSTEMD_VERSION} &amp;&amp;
171make</userinput></screen>
172
173 <note>
174 <para>
175 For the best results, make sure you run the testsuite from
176 a system that is booted by the same
177 <application>systemd</application> version you are rebuilding.
178 </para>
179 </note>
180
181 <para>
182 To test the results, issue: <command>make -k check</command>.
183 </para>
184
185 <warning>
186 <para>
187 Installing the package will override all files installed by
188 <application>systemd</application> in LFS. It is critical that
189 nothing uses either <application>systemd</application> or
190 <application>Udev</application> libraries or programs during
191 the installation phrase. Best way to achieve that is to do the
192 installation in the rescue mode. To switch to the rescue mode,
193 issue the following command as the
194 <systemitem class="username">root</systemitem> user from a TTY:
195 </para>
196
197<screen role="root"><userinput>systemctl start rescue.target</userinput></screen>
198 </warning>
199
200 <para>
201 Now, as the <systemitem class="username">root</systemitem> user:
202 </para>
203
204<screen role="root"><userinput>make install</userinput></screen>
205
206 <para>
207 Prevent systemd units that are not needed on a LFS system from
208 running by running the following command as the <systemitem
209 class="username">root</systemitem> user:
210 </para>
211
212<screen role="root"><userinput>rm -fv /lib/systemd/system/sysinit.target.wants/systemd-{firstboot,sysusers,update-done}.service</userinput></screen>
213
214 <para>
215 Move NSS libraries to <filename class="directory">/lib</filename>
216 by running the following command as the <systemitem
217 class="username">root</systemitem> user:
218 </para>
219
220<screen role="root"><userinput>mv -v /usr/lib/libnss_{myhostname,mymachines,resolve}.so.2 /lib</userinput></screen>
221
222 <para>
223 Remove an unnecessary directory by running the following command
224 as the <systemitem class="username">root</systemitem> user:
225 </para>
226
227<screen role="root"><userinput>rm -rfv /usr/lib/rpm</userinput></screen>
228
229 <para>
230 Remove a reference to a non-existent group by running the following
231 command as the <systemitem class="username">root</systemitem> user:
232 </para>
233
234<screen role="root"><userinput>sed -i "s:0775 root lock:0755 root root:g" /usr/lib/tmpfiles.d/legacy.conf</userinput></screen>
235
236 </sect2>
237
238 <sect2 role="configuration">
239 <title>Configuring systemd</title>
240
241 <para>
242 If the <application>systemd</application> PAM module was built,
243 the <filename>/etc/pam.d/system-sesion</filename> file needs to
244 be modified and a new file needs to be created in order for
245 <command>systemd-logind</command> to work correctly. To accomplish
246 that, run the following commands as the <systemitem
247 class="username">root</systemitem> user:
248 </para>
249
250<screen role="root"><userinput>cat &gt;&gt; /etc/pam.d/system-session &lt;&lt; "EOF"
251<literal># Begin Systemd addition
252
253session required pam_loginuid.so
254-session optional pam_systemd.so
255
256# End Systemd addition</literal>
257EOF
258
259cat &gt; /etc/pam.d/systemd-user &lt;&lt; "EOF"
260<literal># Begin /etc/pam.d/systemd-user
261
262account required pam_access.so
263account include system-account
264
265session required pam_env.so
266session required pam_limits.so
267session include system-session
268
269auth required pam_deny.so
270password required pam_deny.so
271
272# End /etc/pam.d/systemd-user</literal>
273EOF</userinput></screen>
274
275 <para>
276 At this point it would be a nice idea to reboot to
277 test if the reinstallation was sucessful.
278 </para>
279
280 </sect2>
281
282 <sect2 role="content">
283 <title>Contents</title>
284
285 <para>
286 A list of the installed files, along with their short
287 descriptions can be found at
288 <ulink url="http://www.linuxfromscratch.org/lfs/view/systemd/chapter06/systemd.html#contents-systemd"/>.
289 </para>
290
291 <para>
292 Below are listed newly installed libraries and directories
293 along with short descriptions.
294 </para>
295
296 <segmentedlist>
297 <segtitle>Installed Programs</segtitle>
298 <segtitle>Installed Libraries</segtitle>
299 <segtitle>Installed Directories</segtitle>
300
301 <seglistitem>
302 <seg>
303 None
304 </seg>
305 <seg>
306 libgudev-1.0.so and pam_systemd.so
307 (in <filename class="directory">/lib/security</filename>)
308 </seg>
309 <seg>
310 /usr/include/gudev-1.0 and
311 /usr/share/gtk-doc/html/gudev
312 </seg>
313 </seglistitem>
314 </segmentedlist>
315
316 <variablelist>
317 <bridgehead renderas="sect3">Short Descriptions</bridgehead>
318 <?dbfo list-presentation="list"?>
319 <?dbhtml list-presentation="table"?>
320
321 <varlistentry id="libgudev-1.0">
322 <term><filename class="libraryfile">libgudev-1.0.so</filename></term>
323 <listitem>
324 <para>
325 is a GObject-based wrapper library for libudev.
326 </para>
327 <indexterm zone="systemd libgudev-1.0">
328 <primary sortas="c-libgudev-1.0">libgudev-1.0.so</primary>
329 </indexterm>
330 </listitem>
331 </varlistentry>
332
333 <varlistentry id="pam_systemd">
334 <term><filename class="libraryfile">pam_systemd.so</filename></term>
335 <listitem>
336 <para>
337 is a PAM module used to register user sessions with the
338 <application>systemd</application> login manager,
339 <command>systemd-logind</command>.
340 </para>
341 <indexterm zone="systemd pam_systemd">
342 <primary sortas="c-pam_systemd">pam_systemd.so</primary>
343 </indexterm>
344 </listitem>
345 </varlistentry>
346
347 </variablelist>
348
349 </sect2>
350
351</sect1>
Note: See TracBrowser for help on using the repository browser.