source: general/sysutils/dbus.xml@ cafc6c84

10.0 10.1 11.0 11.1 11.2 11.3 12.0 12.1 7.10 7.5 7.6 7.6-blfs 7.6-systemd 7.7 7.8 7.9 8.0 8.1 8.2 8.3 8.4 9.0 9.1 basic bdubbs/svn elogind gnome kde5-13430 kde5-14269 kde5-14686 kea ken/TL2024 ken/inkscape-core-mods ken/tuningfonts krejzi/svn lazarus lxqt nosym perl-modules plabs/newcss plabs/python-mods python3.11 qt5new rahul/power-profiles-daemon renodr/vulkan-addition systemd-11177 systemd-13485 trunk upgradedb xry111/intltool xry111/llvm18 xry111/soup3 xry111/test-20220226 xry111/xf86-video-removal
Last change on this file since cafc6c84 was cafc6c84, checked in by Fernando de Oliveira <fernando@…>, 10 years ago

Fix tests for D-Bus-1.8.0. Thanks Armin K.

git-svn-id: svn://svn.linuxfromscratch.org/BLFS/trunk/BOOK@12728 af4574ff-66df-0310-9fd7-8a98e5e911e0

  • Property mode set to 100644
File size: 18.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-&dbus-version;.tar.gz">
8 <!ENTITY dbus-download-ftp " ">
9 <!ENTITY dbus-md5sum "059fbe84e39fc99c67a14f15b1f39dff">
10 <!ENTITY dbus-size "1.8 MB">
11 <!ENTITY dbus-buildsize "86 MB (additional 26 MB installed)">
12 <!ENTITY dbus-time "0.35 SBU (additional 1.3 SBU for tests)">
13]>
14
15<sect1 id="dbus" xreflabel="D-Bus-&dbus-version;">
16 <?dbhtml filename="dbus.html"?>
17
18 <sect1info>
19 <othername>$LastChangedBy$</othername>
20 <date>$Date$</date>
21 </sect1info>
22
23 <title>D-Bus-&dbus-version;</title>
24
25 <indexterm zone="dbus">
26 <primary sortas="a-D-Bus">D-Bus</primary>
27 </indexterm>
28
29 <sect2 role="package">
30 <title>Introduction to D-Bus</title>
31
32 <para>
33 <application>D-Bus</application> is a message bus system, a simple
34 way for applications to talk to one another.
35 <application>D-Bus</application> supplies both a system daemon (for events
36 such as <quote>new hardware device added</quote> or <quote>printer queue
37 changed</quote>) and a per-user-login-session daemon (for general IPC needs
38 among user applications). Also, the message bus is built on top of a
39 general one-to-one message passing framework, which can be used by any two
40 applications to communicate directly (without going through the message bus
41 daemon).
42 </para>
43
44 &lfs74_checked;
45
46 <bridgehead renderas="sect3">Package Information</bridgehead>
47 <itemizedlist spacing="compact">
48 <listitem>
49 <para>
50 Download (HTTP): <ulink url="&dbus-download-http;"/>
51 </para>
52 </listitem>
53 <listitem>
54 <para>
55 Download (FTP): <ulink url="&dbus-download-ftp;"/>
56 </para>
57 </listitem>
58 <listitem>
59 <para>
60 Download MD5 sum: &dbus-md5sum;
61 </para>
62 </listitem>
63 <listitem>
64 <para>
65 Download size: &dbus-size;
66 </para>
67 </listitem>
68 <listitem>
69 <para>
70 Estimated disk space required: &dbus-buildsize;
71 </para>
72 </listitem>
73 <listitem>
74 <para>
75 Estimated build time: &dbus-time;
76 </para>
77 </listitem>
78 </itemizedlist>
79
80 <bridgehead renderas="sect3">D-Bus Dependencies</bridgehead>
81
82 <bridgehead renderas="sect4">Required</bridgehead>
83 <para role="required">
84 <xref linkend="expat"/>
85 </para>
86
87 <bridgehead renderas="sect4">Recommended</bridgehead>
88 <para role="recommended">
89 <xref linkend="xorg7-lib"/>
90 (for <command>dbus-launch</command> program)
91 </para>
92
93 <bridgehead renderas="sect4">Optional</bridgehead>
94 <para role="optional">
95 To run tests:
96 <xref linkend="dbus-glib"/>,
97 <xref linkend="dbus-python"/>, and
98 <xref linkend="pygobject2"/>;
99 and to generate the API documentation:
100 <xref linkend="doxygen"/>
101 </para>
102
103 <para>
104 Note that the <command>configure</command> script will look for
105 <xref linkend="xmlto"/> but it does nothing as the XML/HTML documentation is
106 already shipped in the source tree.
107 </para>
108
109 <para condition="html" role="usernotes">User Notes:
110 <ulink url="&blfs-wiki;/dbus"/>
111 </para>
112 </sect2>
113
114 <sect2 role="installation">
115 <title>Installation of D-Bus</title>
116
117 <para>
118 As the <systemitem class="username">root</systemitem> user, create a
119 system user and group to handle the system message bus activity:
120 </para>
121
122<screen role="root"><userinput>groupadd -g 18 messagebus &amp;&amp;
123useradd -c "D-Bus Message Daemon User" -d /var/run/dbus \
124 -u 18 -g messagebus -s /bin/false messagebus</userinput></screen>
125
126 <para>
127 Install <application>D-Bus</application> by running the following
128 commands (you may wish to review the output from
129 <command>./configure --help</command> first and add any desired parameters
130 to the <command>configure</command> command shown below):
131 </para>
132
133<screen><userinput>./configure --prefix=/usr \
134 --sysconfdir=/etc \
135 --localstatedir=/var \
136 --libexecdir=/usr/lib/dbus-1.0 \
137 --with-console-auth-dir=/run/console/ \
138 --without-systemdsystemunitdir \
139 --disable-systemd \
140 --disable-static &amp;&amp;
141make</userinput></screen>
142
143 <para>
144 See below for test instructions.
145 </para>
146
147 <para>
148 Now, as the <systemitem class="username">root</systemitem> user:
149 </para>
150
151<screen role="root"><userinput>make install &amp;&amp;
152mv -v /usr/share/doc/dbus /usr/share/doc/dbus-&dbus-version;</userinput></screen>
153
154 <para>
155 If you are still building your system in chroot or you did not start the
156 daemon yet, but you want to compile some packages that require
157 <application>D-Bus</application>, generate
158 <application>D-Bus</application> UUID to avoid warnings when compiling
159 some packages with the following command as the
160 <systemitem class="username">root</systemitem> user:
161 </para>
162
163<screen role="root"><userinput>dbus-uuidgen --ensure</userinput></screen>
164
165 <para>
166 The dbus tests cannot be run until after <xref linkend="dbus-glib"/>
167 has been installed. They must be run as an unprivileged user from a
168 local session. Tests fail through ssh. If you want to run only the unit
169 tests, replace, below, <parameter>--enable-tests</parameter> by
170 <parameter>--enable-embedded-tests</parameter>, otherwise,
171 <xref linkend="dbus-python"/> has to be installed, before.
172 The tests require passing additional parameters to
173 <command>configure</command> and exposing additional functionality in
174 the binaries. These interfaces are not intended to be used in a
175 production build of <application>D-Bus</application>. If you would
176 like to run the tests, issue the following commands:
177 </para>
178
179<screen><userinput>make distclean &amp;&amp;
180./configure --enable-tests --enable-asserts &amp;&amp;
181make &amp;&amp;
182make check &amp;&amp;
183make distclean</userinput></screen>
184
185 <para>
186 If <command>run-test.sh</command> fails, it can be disabled with the
187 following sed, before running the commands for the tests:
188 </para>
189
190<screen><userinput>sed -i -e 's:run-test.sh:$(NULL):g' test/name-test/Makefile.in</userinput></screen>
191
192 <para>
193 Note there has been a report that the tests may fail if running
194 inside a Midnight Commander shell.
195 You may get out-of-memory error messages when running the tests.
196 These are normal and can be safely ignored.
197 </para>
198
199 </sect2>
200
201 <sect2 role="commands">
202 <title>Command Explanations</title>
203
204 <para>
205 <parameter>--with-console-auth-dir=/run/console/</parameter>: This
206 parameter specifies location of the
207 <application>ConsoleKit</application> auth dir.
208 </para>
209
210 <para>
211 <parameter>--without-systemdsystemunitdir</parameter>: This switch
212 prevents installation of systemd unit files.
213 </para>
214
215 <para>
216 <parameter>--disable-systemd</parameter>: This switch disables systemd
217 support in <application>D-Bus</application>
218 </para>
219
220 <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
221 href="../../xincludes/static-libraries.xml"/>
222
223 <para>
224 <parameter>--enable-tests</parameter>: Build extra parts of the code to
225 support all tests. Configure will end with a NOTE warning about increased
226 size of libraries and decreased security.
227 </para>
228
229 <para>
230 <parameter>--enable-embedded-tests</parameter>: Build extra parts of the
231 code to support only unit tests. Configure will end with a NOTE warning
232 about increased size of libraries and decreased security.
233 </para>
234
235 <para>
236 <parameter>--enable-asserts</parameter>: Enable debugging code to run
237 assertions for statements normally assumed to be true. This prevents a
238 warning that '<parameter>--enable-tests</parameter>' on its own is only
239 useful for profiling and might not give true results for all tests, but
240 adds its own NOTE that this should not be used in a production build.
241 </para>
242
243 </sect2>
244
245 <sect2 role="configuration">
246 <title>Configuring dbus</title>
247
248 <sect3 id="dbus-config">
249 <title>Config Files</title>
250
251 <para>
252 <filename>/etc/dbus-1/session.conf</filename>,
253 <filename>/etc/dbus-1/system.conf</filename> and
254 <filename>/etc/dbus-1/system.d/*</filename>
255 </para>
256
257 <indexterm zone="dbus dbus-config">
258 <primary sortas="e-etc-dbus-1-session.conf">/etc/dbus-1/session.conf</primary>
259 </indexterm>
260
261 <indexterm zone="dbus dbus-config">
262 <primary sortas="e-etc-dbus-1/system.conf">/etc/dbus-1/system.conf</primary>
263 </indexterm>
264
265 <indexterm zone="dbus dbus-config">
266 <primary sortas="e-etc-dbus-1-system.d-star">/etc/dbus-1/system.d/*</primary>
267 </indexterm>
268
269 </sect3>
270
271 <sect3 id="dbus-session-config" xreflabel="D-Bus custom services directory">
272 <title>Configuration Information</title>
273
274 <para>
275 The configuration files listed above should probably not be
276 modified. If changes are required, you should create
277 <filename>/etc/dbus-1/session-local.conf</filename> and/or
278 <filename>/etc/dbus-1/system-local.conf</filename> and make any
279 desired changes to these files.
280 </para>
281
282 <para>
283 If any packages install a
284 <application>D-Bus</application> <filename>.service</filename>
285 file outside of the standard <filename
286 class="directory">/usr/share/dbus-1/services</filename> directory,
287 that directory should be added to the local session configuration.
288 For instance, <filename
289 class="directory">/usr/local/share/dbus-1/services</filename> can
290 be added by performing the following commands as the
291 <systemitem class="username">root</systemitem> user:
292 </para>
293
294<screen role="root"><userinput>cat &gt; /etc/dbus-1/session-local.conf &lt;&lt; "EOF"
295<literal>&lt;!DOCTYPE busconfig PUBLIC
296 "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
297 "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd"&gt;
298&lt;busconfig&gt;
299
300 &lt;!-- Search for .service files in /usr/local --&gt;
301 &lt;servicedir&gt;/usr/local/share/dbus-1/services&lt;/servicedir&gt;
302
303&lt;/busconfig&gt;</literal>
304EOF</userinput></screen>
305
306 </sect3>
307
308 <sect3 id="dbus-init">
309 <title>Boot Script</title>
310
311 <para>
312 To automatically start <command>dbus-daemon</command> when the
313 system is rebooted, install the
314 <filename>/etc/rc.d/init.d/dbus</filename> bootscript from the
315 <xref linkend="bootscripts"/> package.
316 </para>
317
318 <indexterm zone="dbus dbus-init">
319 <primary sortas="f-dbus">dbus</primary>
320 </indexterm>
321
322<screen role="root"><userinput>make install-dbus</userinput></screen>
323
324 <para>
325 Note that this boot script only starts the system-wide
326 <application>D-Bus</application> daemon. Each user requiring access to
327 <application>D-Bus</application> services will also need to run a
328 session daemon as well. There are many methods you can use to start a
329 session daemon using the <command>dbus-launch</command> command. Review
330 the <command>dbus-launch</command> man page for details about the
331 available parameters and options. Here are some suggestions and
332 examples:
333 </para>
334
335 <itemizedlist spacing="compact">
336 <listitem>
337 <para>
338 Add <command>dbus-launch</command> to the line in the
339 <filename>~/.xinitrc</filename> file that starts your graphical
340 desktop environment.
341 </para>
342 </listitem>
343 <listitem>
344 <para>
345 If you use <command>xdm</command> or some other display manager
346 that calls the <filename>~/.xsession</filename> file, you can add
347 <command>dbus-launch</command> to the line in your
348 <filename>~/.xsession</filename> file that starts your graphical
349 desktop environment. The syntax would be similar to the example in
350 the <filename>~/.xinitrc</filename> file.
351 </para>
352 </listitem>
353 <listitem>
354 <para>
355 The examples shown previously use
356 <command>dbus-launch</command> to specify a program to be run. This
357 has the benefit (when also using the
358 <parameter>--exit-with-session</parameter> parameter) of stopping the
359 session daemon when the specified program is stopped. You can also
360 start the session daemon in your system or personal startup scripts
361 by adding the following lines:
362 </para>
363
364<screen><userinput><literal># Start the D-Bus session daemon
365eval `dbus-launch`
366export DBUS_SESSION_BUS_ADDRESS</literal></userinput></screen>
367
368 <para>
369 This method will not stop the session daemon when you exit
370 your shell, therefore you should add the following line to your
371 <filename>~/.bash_logout</filename> file:
372 </para>
373
374<screen><userinput><literal># Kill the D-Bus session daemon
375kill $DBUS_SESSION_BUS_PID</literal></userinput></screen>
376 </listitem>
377
378 <listitem>
379 <para>
380 A hint has been written that provides ways to start scripts
381 using the KDM session manager of KDE. The concepts in this hint could
382 possibly be used with other session managers as well. The hint is
383 located at <ulink
384 url="&hints-root;/downloads/files/execute-session-scripts-using-kdm.txt"/>.
385 </para>
386 </listitem>
387
388 </itemizedlist>
389
390 </sect3>
391
392 </sect2>
393
394 <sect2 role="content">
395 <title>Contents</title>
396
397 <segmentedlist>
398 <segtitle>Installed Programs</segtitle>
399 <segtitle>Installed Library</segtitle>
400 <segtitle>Installed Directories</segtitle>
401
402 <seglistitem>
403 <seg>
404 dbus-cleanup-sockets, dbus-daemon, dbus-launch, dbus-monitor,
405 dbus-run-session, dbus-send and dbus-uuidgen
406 </seg>
407 <seg>
408 libdbus-1.so
409 </seg>
410 <seg>
411 /etc/dbus-1,
412 /usr/include/dbus-1.0,
413 /usr/lib/dbus-1.0,
414 /usr/share/dbus-1,
415 /usr/share/doc/dbus-&dbus-version;,
416 /var/lib/dbus and
417 /var/run/dbus
418 </seg>
419 </seglistitem>
420 </segmentedlist>
421
422 <variablelist>
423 <bridgehead renderas="sect3">Short Descriptions</bridgehead>
424 <?dbfo list-presentation="list"?>
425 <?dbhtml list-presentation="table"?>
426
427 <varlistentry id="dbus-cleanup-sockets">
428 <term><command>dbus-cleanup-sockets</command></term>
429 <listitem>
430 <para>
431 is used to clean up leftover sockets in a directory.
432 </para>
433 <indexterm zone="dbus dbus-cleanup-sockets">
434 <primary sortas="b-dbus-cleanup-sockets">dbus-cleanup-sockets</primary>
435 </indexterm>
436 </listitem>
437 </varlistentry>
438
439 <varlistentry id="dbus-daemon">
440 <term><command>dbus-daemon</command></term>
441 <listitem>
442 <para>
443 is the <application>D-Bus</application> message bus daemon.
444 </para>
445 <indexterm zone="dbus dbus-daemon">
446 <primary sortas="b-dbus-daemon">dbus-daemon</primary>
447 </indexterm>
448 </listitem>
449 </varlistentry>
450
451 <varlistentry id="dbus-launch">
452 <term><command>dbus-launch</command></term>
453 <listitem>
454 <para>
455 is used to start <command>dbus-daemon</command> from a shell
456 script. It would normally be called from a user's login
457 scripts.
458 </para>
459 <indexterm zone="dbus dbus-launch">
460 <primary sortas="b-dbus-launch">dbus-launch</primary>
461 </indexterm>
462 </listitem>
463 </varlistentry>
464
465 <varlistentry id="dbus-monitor">
466 <term><command>dbus-monitor</command></term>
467 <listitem>
468 <para>
469 is used to monitor messages going through a
470 <application>D-Bus</application> message bus.
471 </para>
472 <indexterm zone="dbus dbus-monitor">
473 <primary sortas="b-dbus-monitor">dbus-monitor</primary>
474 </indexterm>
475 </listitem>
476 </varlistentry>
477
478 <varlistentry id="dbus-run-session">
479 <term><command>dbus-run-session</command></term>
480 <listitem>
481 <para>
482 start a process as a new <application>D-Bus</application> session.
483 </para>
484 <indexterm zone="dbus dbus-run-session">
485 <primary sortas="b-dbus-run-session">dbus-run-session</primary>
486 </indexterm>
487 </listitem>
488 </varlistentry>
489
490 <varlistentry id="dbus-send">
491 <term><command>dbus-send</command></term>
492 <listitem>
493 <para>
494 is used to send a message to a <application>D-Bus</application>
495 message bus.
496 </para>
497 <indexterm zone="dbus dbus-send">
498 <primary sortas="b-dbus-send">dbus-send</primary>
499 </indexterm>
500 </listitem>
501 </varlistentry>
502
503 <varlistentry id="dbus-uuidgen">
504 <term><command>dbus-uuidgen</command></term>
505 <listitem>
506 <para>
507 is used to generate a universally unique ID.
508 </para>
509 <indexterm zone="dbus dbus-uuidgen">
510 <primary sortas="b-dbus-uuidgen">dbus-uuidgen</primary>
511 </indexterm>
512 </listitem>
513 </varlistentry>
514
515 <varlistentry id="libdbus-1">
516 <term><filename class="libraryfile">libdbus-1.so</filename></term>
517 <listitem>
518 <para>
519 contains the API functions used by the
520 <application>D-Bus</application> message daemon.
521 <application>D-Bus</application> is first a library that provides
522 one-to-one communication between any two applications;
523 <command>dbus-daemon</command> is an application that uses this
524 library to implement a message bus daemon.
525 </para>
526 <indexterm zone="dbus libdbus-1">
527 <primary sortas="c-libdbus-1">libdbus-1.so</primary>
528 </indexterm>
529 </listitem>
530 </varlistentry>
531
532 </variablelist>
533
534 </sect2>
535
536</sect1>
537
Note: See TracBrowser for help on using the repository browser.