source: general/sysutils/dbus.xml@ 8ee0429

systemd-13485
Last change on this file since 8ee0429 was 8ee0429, checked in by Douglas R. Reno <renodr@…>, 8 years ago

(systemd) LFS79 Tags
(systemd) Tons of GCC6 Tags

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

  • Property mode set to 100644
File size: 14.4 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 dbus-download-http "http://dbus.freedesktop.org/releases/dbus/dbus-&lfs-dbus-version;.tar.gz">
8]>
9
10<sect1 id="dbus" xreflabel="D-Bus-&lfs-dbus-version;">
11 <?dbhtml filename="dbus.html"?>
12
13 <sect1info>
14 <othername>$LastChangedBy$</othername>
15 <date>$Date$</date>
16 </sect1info>
17
18 <title>D-Bus-&lfs-dbus-version;</title>
19
20 <indexterm zone="dbus">
21 <primary sortas="a-D-Bus">D-Bus</primary>
22 </indexterm>
23
24 <sect2 role="package">
25 <title>Introduction to D-Bus</title>
26
27 <para>
28 Even though <application>D-Bus</application> was built in
29 LFS, there are some features provided by the package that
30 some BLFS packages need, but their dependencies didn't fit
31 into LFS.
32 </para>
33<!--
34 <para>
35 Unlike other packages in BLFS, there is no set version of
36 <application>D-Bus</application> in this page's title and
37 no set version specified for download. Version updates to
38 <application>D-Bus</application> make it possible that the
39 user's system may have a <application>D-Bus</application>
40 version different from the one in the current LFS book.
41 Therefore, users should use the version of
42 <application>D-Bus</application> that is currently
43 installed on their system.
44 </para>
45-->
46 &lfs79_checked;&gcc6_checked;
47
48 <bridgehead renderas="sect3">Package Information</bridgehead>
49 <itemizedlist spacing="compact">
50 <listitem>
51 <para>
52 Download (HTTP): <ulink url="&dbus-download-http;"/>
53 </para>
54 </listitem>
55 </itemizedlist>
56<!--
57 <note>
58 <para>
59 If you are unsure which version needs to be downloaded, issue
60 <command>dbus-daemon - -version</command> in order to find out.
61 Some of the commands below might need the version information.
62 Issue the following command to store the
63 <application>D-Bus</application> version number into an
64 environment variable:
65 </para>
66
67<screen><userinput>export DBUS_VERSION=$(dbus-daemon - -version | head -n1 | awk '{print $5}')</userinput></screen>
68 </note>
69-->
70 <bridgehead renderas="sect3">D-Bus Dependencies</bridgehead>
71
72 <bridgehead renderas="sect4">Required</bridgehead>
73 <para role="required">
74 <xref linkend="xorg7-lib"/> (for X11 autolaunch support)
75 </para>
76
77 <bridgehead renderas="sect4">Optional</bridgehead>
78 <para role="optional">
79 For the tests:
80 <xref linkend="dbus-glib"/>,
81 <xref linkend="dbus-python"/>,
82 <xref linkend="pygobject2"/> and
83 <xref linkend="valgrind"/>;
84
85 for documentation:
86 <xref linkend="doxygen"/>,
87 <xref linkend="xmlto"/>,
88 <ulink url="https://pypi.python.org/pypi/mallard-ducktype">Ducktype</ulink>,
89 and
90 <ulink url="http://ftp.gnome.org/pub/gnome/sources/yelp-tools/">Yelp Tools</ulink>
91 </para>
92
93 <para condition="html" role="usernotes">User Notes:
94 <ulink url="&blfs-wiki;/dbus"/>
95 </para>
96 </sect2>
97
98 <sect2 role="installation">
99 <title>Installation of D-Bus</title>
100
101 <para>
102 Rebuild <application>D-Bus</application> by running the
103 following commands:
104 </para>
105
106<screen><userinput>./configure --prefix=/usr \
107 --sysconfdir=/etc \
108 --localstatedir=/var \
109 --with-console-auth-dir=/run/console \
110 --docdir=/usr/share/doc/dbus-&lfs-dbus-version; &amp;&amp;
111make</userinput></screen>
112
113 <para>
114 See below for test instructions.
115 </para>
116
117 <warning>
118 <para>
119 Installing the package will override all files installed by
120 <application>D-Bus</application> in LFS. It is critical that
121 nothing uses <application>D-Bus</application> libraries or
122 programs during the installation. The best way to ensure that these
123 libraries are not being used is to run the installation in rescue mode.
124 To switch to rescue mode, run the following command as the
125 <systemitem class="username">root</systemitem> user (from a TTY):
126 </para>
127
128<screen role="root"><userinput>systemctl start rescue.target</userinput></screen>
129 </warning>
130
131 <para>
132 Now, as the <systemitem class="username">root</systemitem> user:
133 </para>
134
135<screen role="root"><userinput>make install</userinput></screen>
136
137 <para>
138 The shared library needs to be moved to
139 <filename class="directory">/lib</filename>, and as a result the
140 <filename class="extension">.so</filename> file in
141 <filename class="directory">/usr/lib</filename> will need to be
142 recreated. Run the following command as the
143 <systemitem class="username">root</systemitem> user:
144 </para>
145
146<screen><userinput remap="install">mv -v /usr/lib/libdbus-1.so.* /lib
147ln -sfv ../../lib/$(readlink /usr/lib/libdbus-1.so) /usr/lib/libdbus-1.so</userinput></screen>
148
149 <para>
150 If you are using a DESTDIR install,
151 <command>dbus-daemon-launch-helper</command> needs to be fixed
152 afterwards. Issue, as <systemitem class="username">root</systemitem>
153 user:
154 </para>
155
156<screen role="root"><userinput>chown -v root:messagebus /usr/libexec/dbus-daemon-launch-helper &amp;&amp;
157chmod -v 4750 /usr/libexec/dbus-daemon-launch-helper</userinput></screen>
158
159
160 <para>
161 At this point, you should reload the systemd daemon, and reenter
162 multi-user mode with the following commands (as the
163 <systemitem class="username">root</systemitem> user):
164 </para>
165
166<screen role="root"><userinput>systemctl daemon-reload
167systemctl start multi-user.target</userinput></screen>
168
169 <para>
170 The <application>D-Bus</application> tests cannot be run until after
171 <xref linkend="dbus-glib"/> has been installed. They must be run as
172 an unprivileged user from a local session. If you want to run only
173 the unit tests, replace <parameter>--enable-tests</parameter> in the
174 command below with <parameter>--enable-embedded-tests</parameter>,
175 otherwise <xref linkend="dbus-python"/> has to be installed before
176 the tests are run. The tests require passing additional parameters to
177 <command>configure</command> and exposing additional functionality in
178 the binaries. These interfaces are not intended to be used in a
179 production build of <application>D-Bus</application>. If you would
180 like to run the tests, issue the following commands:
181 </para>
182
183<screen><userinput>make distclean &amp;&amp;
184./configure --enable-tests \
185 --enable-asserts \
186 --disable-doxygen-docs \
187 --disable-xml-docs \
188 --disable-static \
189 --with-console-auth-dir=/run/console/ \
190 --docdir=/usr/share/doc/dbus-&lfs-dbus-version; &amp;&amp;
191make &amp;&amp;
192make check</userinput></screen>
193
194 <para>
195 There has been a report that the tests may fail if running inside a
196 Midnight Commander shell. You may get out-of-memory error messages when
197 running the tests. These are normal and can be safely ignored.
198 </para>
199
200 </sect2>
201
202 <sect2 role="commands">
203 <title>Command Explanations</title>
204
205 <para>
206 <parameter>--disable-doxygen-docs</parameter>: This switch disables
207 doxygen documentation build and install, if you have
208 <application>doxygen</application> installed. Delete, if
209 <application>doxygen</application> is installed and you wish to build and
210 install them.
211 </para>
212
213 <para>
214 <parameter>--disable-xml-docs</parameter>: This switch disables html
215 documentation build and install, if you have
216 <application>xmlto</application> installed. Delete, if
217 <application>xmlto</application> is installed and you wish to build and
218 install them.
219 </para>
220
221 <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
222 href="../../xincludes/static-libraries.xml"/>
223
224 <para>
225 <parameter>--with-console-auth-dir=/run/console/</parameter>: This
226 parameter specifies location of the
227 <application>ConsoleKit</application> auth dir.
228 </para>
229
230 <para>
231 <parameter>--enable-tests</parameter>: Build extra parts of the code to
232 support all tests. Configure will end with a NOTE warning about increased
233 size of libraries and decreased security.
234 </para>
235
236 <para>
237 <parameter>--enable-embedded-tests</parameter>: Build extra parts of the
238 code to support only unit tests. Configure will end with a NOTE warning
239 about increased size of libraries and decreased security.
240 </para>
241
242 <para>
243 <parameter>--enable-asserts</parameter>: Enable debugging code to run
244 assertions for statements normally assumed to be true. This prevents a
245 warning that '<parameter>--enable-tests</parameter>' on its own is only
246 useful for profiling and might not give true results for all tests, but
247 adds its own NOTE that this should not be used in a production build.
248 </para>
249
250 </sect2>
251
252 <sect2 role="configuration">
253 <title>Configuring D-Bus</title>
254
255 <sect3 id="dbus-config">
256 <title>Config Files</title>
257
258 <para>
259 <filename>/etc/dbus-1/session.conf</filename>,
260 <filename>/etc/dbus-1/system.conf</filename> and
261 <filename>/etc/dbus-1/system.d/*</filename>
262 </para>
263
264 <indexterm zone="dbus dbus-config">
265 <primary sortas="e-etc-dbus-1-session.conf">/etc/dbus-1/session.conf</primary>
266 </indexterm>
267
268 <indexterm zone="dbus dbus-config">
269 <primary sortas="e-etc-dbus-1/system.conf">/etc/dbus-1/system.conf</primary>
270 </indexterm>
271
272 <indexterm zone="dbus dbus-config">
273 <primary sortas="e-etc-dbus-1-system.d-star">/etc/dbus-1/system.d/*</primary>
274 </indexterm>
275
276 </sect3>
277
278 <sect3 id="dbus-session-config" xreflabel="D-Bus custom services directory">
279 <title>Configuration Information</title>
280
281 <para>
282 The configuration files listed above should probably not be
283 modified. If changes are required, you should create
284 <filename>/etc/dbus-1/session-local.conf</filename> and/or
285 <filename>/etc/dbus-1/system-local.conf</filename> and make any
286 desired changes to these files.
287 </para>
288
289 <para>
290 If any packages install a
291 <application>D-Bus</application> <filename>.service</filename>
292 file outside of the standard <filename
293 class="directory">/usr/share/dbus-1/services</filename> directory,
294 that directory should be added to the local session configuration.
295 For instance, <filename
296 class="directory">/usr/local/share/dbus-1/services</filename> can
297 be added by performing the following commands as the
298 <systemitem class="username">root</systemitem> user:
299 </para>
300
301<screen role="root"><userinput>cat &gt; /etc/dbus-1/session-local.conf &lt;&lt; "EOF"
302<literal>&lt;!DOCTYPE busconfig PUBLIC
303 "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
304 "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd"&gt;
305&lt;busconfig&gt;
306
307 &lt;!-- Search for .service files in /usr/local --&gt;
308 &lt;servicedir&gt;/usr/local/share/dbus-1/services&lt;/servicedir&gt;
309
310&lt;/busconfig&gt;</literal>
311EOF</userinput></screen>
312
313 </sect3>
314
315 <sect3 id="dbus-session">
316 <title>D-Bus Session Daemon</title>
317
318 <para>
319 There are many methods you can use to start a session daemon
320 using the <command>dbus-launch</command> command. Review the
321 <command>dbus-launch</command> man page for details about the
322 available parameters and options. Here are some suggestions and
323 examples:
324 </para>
325
326 <itemizedlist spacing="compact">
327 <listitem>
328 <para>
329 Add <command>dbus-launch</command> to the line in the
330 <filename>~/.xinitrc</filename> file that starts your graphical
331 desktop environment.
332 </para>
333 </listitem>
334 <listitem>
335 <para>
336 If you use <command>xdm</command> or some other display manager
337 that calls the <filename>~/.xsession</filename> file, you can add
338 <command>dbus-launch</command> to the line in your
339 <filename>~/.xsession</filename> file that starts your graphical
340 desktop environment. The syntax would be similar to the example in
341 the <filename>~/.xinitrc</filename> file.
342 </para>
343 </listitem>
344 <listitem>
345 <para>
346 The examples shown previously use
347 <command>dbus-launch</command> to specify a program to be run. This
348 has the benefit (when also using the
349 <parameter>--exit-with-session</parameter> parameter) of stopping the
350 session daemon when the specified program is stopped. You can also
351 start the session daemon in your system or personal startup scripts
352 by adding the following lines:
353 </para>
354
355<screen><userinput><literal># Start the D-Bus session daemon
356eval `dbus-launch`
357export DBUS_SESSION_BUS_ADDRESS</literal></userinput></screen>
358
359 <para>
360 This method will not stop the session daemon when you exit
361 your shell, therefore you should add the following line to your
362 <filename>~/.bash_logout</filename> file:
363 </para>
364
365<screen><userinput><literal># Kill the D-Bus session daemon
366kill $DBUS_SESSION_BUS_PID</literal></userinput></screen>
367 </listitem>
368
369 <listitem>
370 <para>
371 A hint has been written that provides ways to start scripts
372 using the KDM session manager of KDE. The concepts in this hint could
373 possibly be used with other session managers as well. The hint is
374 located at <ulink
375 url="&hints-root;/downloads/files/execute-session-scripts-using-kdm.txt"/>.
376 </para>
377 </listitem>
378
379 </itemizedlist>
380
381 </sect3>
382
383 </sect2>
384
385 <sect2 role="content">
386 <title>Contents</title>
387
388 <para>
389 A list of the installed files, along with their short
390 descriptions can be found at
391 <ulink url="&lfs-root;/chapter06/dbus.html#contents-dbus"/>.
392 </para>
393
394 </sect2>
395
396</sect1>
397
Note: See TracBrowser for help on using the repository browser.