source: general/sysutils/dbus.xml@ 54666831

10.0 10.1 11.0 11.1 11.2 11.3 12.0 12.1 7.10 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 54666831 was 54666831, checked in by Bruce Dubbs <bdubbs@…>, 10 years ago

Restore full dbus build to the book.
Update to dbus-1.8.2.

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

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