source: general/sysutils/dbus.xml@ 845688e

10.0 10.1 11.0 11.1 11.2 11.3 12.0 12.1 7.10 7.8 7.9 8.0 8.1 8.2 8.3 8.4 9.0 9.1 basic bdubbs/svn elogind kea ken/TL2024 ken/inkscape-core-mods ken/tuningfonts lazarus lxqt nosym perl-modules plabs/newcss plabs/python-mods python3.11 qt5new rahul/power-profiles-daemon renodr/vulkan-addition trunk upgradedb xry111/intltool xry111/llvm18 xry111/soup3 xry111/test-20220226 xry111/xf86-video-removal
Last change on this file since 845688e was 163bbac, checked in by Pierre Labastie <pieere@…>, 9 years ago

Tags

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

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