source: general/sysutils/dbus.xml@ ecfa240

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 ecfa240 was ecfa240, checked in by Fernando de Oliveira <fernando@…>, 11 years ago

typo

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

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