source: general/sysutils/dbus.xml@ 3d37094

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

gparted-0.19.0
dbus-1.8.4
stunnel-5.02

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

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