source: general/sysutils/dbus.xml@ 816dc876

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 816dc876 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
RevLine 
[e8e3312d]1<?xml version="1.0" encoding="ISO-8859-1"?>
[6732c094]2<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
3 "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
[e8e3312d]4 <!ENTITY % general-entities SYSTEM "../../general.ent">
5 %general-entities;
6
[bf325a39]7 <!ENTITY dbus-download-http "http://dbus.freedesktop.org/releases/dbus/dbus-&dbus-version;.tar.gz">
[30d0aef]8 <!ENTITY dbus-download-ftp " ">
[0b72043]9 <!ENTITY dbus-md5sum "020824a38850501e7d6ba8307a7c5ac3">
[a27a478]10 <!ENTITY dbus-size "1.8 MB">
[0b72043]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)">
[e8e3312d]13]>
14
[54666831]15<sect1 id="dbus" xreflabel="D-Bus-&dbus-version;">
[e8e3312d]16 <?dbhtml filename="dbus.html"?>
17
18 <sect1info>
19 <othername>$LastChangedBy$</othername>
20 <date>$Date$</date>
21 </sect1info>
22
[54666831]23 <title>D-Bus-&dbus-version;</title>
[e8e3312d]24
[54666831]25 <indexterm zone="dbus">
26 <primary sortas="a-D-Bus">D-Bus</primary>
[e8e3312d]27 </indexterm>
28
29 <sect2 role="package">
[54666831]30 <title>Introduction to D-Bus</title>
[e8e3312d]31
[0b83a69]32 <para>
[108beaf]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).
[0b83a69]42 </para>
[e8e3312d]43
[163bbac]44 &lfs77_checked;
[482477c]45
[e8e3312d]46 <bridgehead renderas="sect3">Package Information</bridgehead>
47 <itemizedlist spacing="compact">
48 <listitem>
[0b83a69]49 <para>
50 Download (HTTP): <ulink url="&dbus-download-http;"/>
51 </para>
[e8e3312d]52 </listitem>
53 <listitem>
[0b83a69]54 <para>
55 Download (FTP): <ulink url="&dbus-download-ftp;"/>
56 </para>
[e8e3312d]57 </listitem>
58 <listitem>
[0b83a69]59 <para>
60 Download MD5 sum: &dbus-md5sum;
61 </para>
[e8e3312d]62 </listitem>
63 <listitem>
[0b83a69]64 <para>
65 Download size: &dbus-size;
66 </para>
[e8e3312d]67 </listitem>
68 <listitem>
[0b83a69]69 <para>
70 Estimated disk space required: &dbus-buildsize;
71 </para>
[e8e3312d]72 </listitem>
73 <listitem>
[0b83a69]74 <para>
75 Estimated build time: &dbus-time;
76 </para>
[e8e3312d]77 </listitem>
78 </itemizedlist>
79
[02e742b]80 <bridgehead renderas="sect3">D-Bus Dependencies</bridgehead>
[e8e3312d]81
[54666831]82<!--
[bf325a39]83 <bridgehead renderas="sect4">Required</bridgehead>
[b6a2a0e]84 <para role="required">
[54666831]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)
[0b83a69]91 </para>
[adfdc8b]92
[e8e3312d]93 <bridgehead renderas="sect4">Optional</bridgehead>
[b6a2a0e]94 <para role="optional">
[f1d25d2]95 For the tests:
[cafc6c84]96 <xref linkend="dbus-glib"/>,
97 <xref linkend="dbus-python"/>, and
[54666831]98 <xref linkend="pygobject2"/>;
99
[108beaf]100 for the development documentation:
[54666831]101 <xref linkend="doxygen"/>;
102
[f1d25d2]103 for man pages and XML/HTML documentation:
104 <xref linkend="xmlto"/>
[0b83a69]105 </para>
[c45cb57]106
[1039de3]107 <para condition="html" role="usernotes">User Notes:
[0b83a69]108 <ulink url="&blfs-wiki;/dbus"/>
109 </para>
[e8e3312d]110 </sect2>
111
112 <sect2 role="installation">
[02e742b]113 <title>Installation of D-Bus</title>
[e8e3312d]114
[0b83a69]115 <para>
[ef52ec2]116 If they do not already exist,
117 as the <systemitem class="username">root</systemitem> user, create a
[54666831]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
[108beaf]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):
[0b83a69]130 </para>
[e8e3312d]131
[8f7569b]132<screen><userinput>./configure --prefix=/usr \
[54666831]133 --sysconfdir=/etc \
134 --localstatedir=/var \
[108beaf]135 --disable-doxygen-docs \
[6092d19]136 --disable-xml-docs \
[108beaf]137 --disable-static \
[4532b2f]138 --disable-systemd \
139 --without-systemdsystemunitdir \
140 --with-console-auth-dir=/run/console/ \
141 --docdir=/usr/share/doc/dbus-&dbus-version; &amp;&amp;
[e8e3312d]142make</userinput></screen>
143
[0b83a69]144 <para>
145 See below for test instructions.
146 </para>
[c45cb57]147
[0b83a69]148 <para>
149 Now, as the <systemitem class="username">root</systemitem> user:
150 </para>
[e8e3312d]151
[108beaf]152<screen role="root"><userinput>make install</userinput></screen>
[b6a2a0e]153
[0b83a69]154 <para>
[54666831]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
[3bbf74c5]160 <systemitem class="username">root</systemitem> user:
161 </para>
162
[54666831]163<screen role="root"><userinput>dbus-uuidgen --ensure</userinput></screen>
164
[3bbf74c5]165 <para>
[108beaf]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,
[6092d19]176 issue the following commands (for the tests, you don't need to build the
177 docs):
[0b83a69]178 </para>
[0d7900a]179
[6092d19]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;
[02fc2ae]186make check</userinput></screen>
[c45cb57]187
[c802d3c]188 <para>
[4947a7a]189 If <command>run-test.sh</command> fails, it can be disabled with the
190 following sed, before running the commands for the tests:
[c802d3c]191 </para>
192
193<screen><userinput>sed -i -e 's:run-test.sh:$(NULL):g' test/name-test/Makefile.in</userinput></screen>
194
[54666831]195 <para>
196 Note there has been a report that the tests may fail if running
[0b83a69]197 inside a Midnight Commander shell.
[0d7900a]198 You may get out-of-memory error messages when running the tests.
[0b83a69]199 These are normal and can be safely ignored.
[54666831]200 </para>
[e8e3312d]201
202 </sect2>
203
204 <sect2 role="commands">
205 <title>Command Explanations</title>
206
[108beaf]207 <para>
208 <parameter>--disable-doxygen-docs</parameter>: This switch disables
[6092d19]209 doxygen documentation build and install, if you have
[108beaf]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
[6092d19]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
[4532b2f]223 <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
224 href="../../xincludes/static-libraries.xml"/>
225
[54666831]226 <para>
227 <parameter>--disable-systemd</parameter>: This switch disables systemd
[108beaf]228 support in <application>D-Bus</application>.
[54666831]229 </para>
230
[4532b2f]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>
[0b83a69]241
242 <para>
[e5347c36]243 <parameter>--enable-tests</parameter>: Build extra parts of the code to
[4947a7a]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.
[0b83a69]252 </para>
253
254 <para>
[e5347c36]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.
[0b83a69]260 </para>
[30d0aef]261
[e8e3312d]262 </sect2>
263
264 <sect2 role="configuration">
265 <title>Configuring dbus</title>
266
267 <sect3 id="dbus-config">
268 <title>Config Files</title>
[0b83a69]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>
[e8e3312d]275
[54666831]276 <indexterm zone="dbus dbus-config">
[e8e3312d]277 <primary sortas="e-etc-dbus-1-session.conf">/etc/dbus-1/session.conf</primary>
278 </indexterm>
279
[54666831]280 <indexterm zone="dbus dbus-config">
[e8e3312d]281 <primary sortas="e-etc-dbus-1/system.conf">/etc/dbus-1/system.conf</primary>
282 </indexterm>
283
[54666831]284 <indexterm zone="dbus dbus-config">
[c45cb57]285 <primary sortas="e-etc-dbus-1-system.d-star">/etc/dbus-1/system.d/*</primary>
[e8e3312d]286 </indexterm>
287
288 </sect3>
289
[e9efab0b]290 <sect3 id="dbus-session-config" xreflabel="D-Bus custom services directory">
291 <title>Configuration Information</title>
[e8e3312d]292
[0b83a69]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>
[57aa7a28]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
[e8e3312d]325 </sect3>
326
327 <sect3 id="dbus-init">
[54666831]328 <title>Boot Script</title>
[e8e3312d]329
[0b83a69]330 <para>
[54666831]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
[0b83a69]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>
[3565e02]353
354 <itemizedlist spacing="compact">
355 <listitem>
[0b83a69]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>
[3565e02]361 </listitem>
362 <listitem>
[0b83a69]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>
[3565e02]371 </listitem>
372 <listitem>
[0b83a69]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>
[3565e02]382
[02e742b]383<screen><userinput><literal># Start the D-Bus session daemon
[3565e02]384eval `dbus-launch`
385export DBUS_SESSION_BUS_ADDRESS</literal></userinput></screen>
386
[0b83a69]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>
[3565e02]392
[02e742b]393<screen><userinput><literal># Kill the D-Bus session daemon
[3565e02]394kill $DBUS_SESSION_BUS_PID</literal></userinput></screen>
[bccbdaea]395 </listitem>
[4ec808b]396
[3565e02]397 <listitem>
[0b83a69]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"/>.
[c45cb57]404 </para>
[3565e02]405 </listitem>
[c45cb57]406
[3565e02]407 </itemizedlist>
408
[e8e3312d]409 </sect3>
410
411 </sect2>
412
413 <sect2 role="content">
414 <title>Contents</title>
415
416 <segmentedlist>
417 <segtitle>Installed Programs</segtitle>
[54666831]418 <segtitle>Installed Library</segtitle>
[e8e3312d]419 <segtitle>Installed Directories</segtitle>
420
421 <seglistitem>
[0b83a69]422 <seg>
[54666831]423 dbus-cleanup-sockets, dbus-daemon, dbus-launch, dbus-monitor,
424 dbus-run-session, dbus-send and dbus-uuidgen
[0b83a69]425 </seg>
426 <seg>
[54666831]427 libdbus-1.so
[0b83a69]428 </seg>
429 <seg>
[54666831]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
[0b83a69]437 </seg>
[e8e3312d]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
[54666831]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">
[e8e3312d]471 <term><command>dbus-launch</command></term>
472 <listitem>
[0b83a69]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>
[54666831]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>
[e8e3312d]547 </indexterm>
548 </listitem>
549 </varlistentry>
550
551 </variablelist>
552
553 </sect2>
554
555</sect1>
[0d7900a]556
Note: See TracBrowser for help on using the repository browser.