source: general/sysutils/dbus.xml@ 670d3f8

10.0 10.1 11.0 11.1 11.2 11.3 12.0 12.1 7.10 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 670d3f8 was 670d3f8, checked in by DJ Lucas <dj@…>, 8 years ago

Fix missed changes between revisions for D-Bus.

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

  • Property mode set to 100644
File size: 23.8 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 "e912e930f249454752512aa7ac864d43">
10 <!ENTITY dbus-size "1.9 MB">
11 <!ENTITY dbus-buildsize "24 MB (70 MB for the tests)">
12 <!ENTITY dbus-time "0.4 SBU (add 2 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 revision="sysv">
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 <para revision="systemd">
45 Even though <application>D-Bus</application> was built in LFS, there are
46 some features provided by the package that other BLFS packages need, but
47 their dependencies didn't fit into LFS.
48 </para>
49
50 &lfs79_checked;&gcc6_checked;
51
52 <bridgehead renderas="sect3">Package Information</bridgehead>
53 <itemizedlist spacing="compact">
54 <listitem>
55 <para>
56 Download (HTTP): <ulink url="&dbus-download-http;"/>
57 </para>
58 </listitem>
59 <listitem>
60 <para>
61 Download (FTP): <ulink url="&dbus-download-ftp;"/>
62 </para>
63 </listitem>
64 <listitem>
65 <para>
66 Download MD5 sum: &dbus-md5sum;
67 </para>
68 </listitem>
69 <listitem>
70 <para>
71 Download size: &dbus-size;
72 </para>
73 </listitem>
74 <listitem>
75 <para>
76 Estimated disk space required: &dbus-buildsize;
77 </para>
78 </listitem>
79 <listitem>
80 <para>
81 Estimated build time: &dbus-time;
82 </para>
83 </listitem>
84 </itemizedlist>
85
86 <bridgehead renderas="sect3">D-Bus Dependencies</bridgehead>
87
88<!--
89 <bridgehead renderas="sect4">Required</bridgehead>
90 <para role="required">
91 <xref linkend="expat"/>
92 </para>
93-->
94 <bridgehead renderas="sect4">Recommended</bridgehead>
95 <para role="recommended">
96 <xref linkend="xorg7-lib"/> (for <command>dbus-launch</command> program)
97 </para>
98
99 <bridgehead renderas="sect4">Optional</bridgehead>
100 <para role="optional">
101 For the tests:
102 <xref linkend="dbus-glib"/>,
103 <xref linkend="dbus-python"/>,
104 <xref linkend="pygobject2"/>, and
105 <xref linkend="valgrind"/>;
106
107 for documentation:
108 <xref linkend="doxygen"/>,
109 <xref linkend="xmlto"/>,
110 <ulink url="https://pypi.python.org/pypi/mallard-ducktype">Ducktype</ulink>,
111 and
112 <ulink url="http://ftp.gnome.org/pub/gnome/sources/yelp-tools/">Yelp Tools</ulink>
113 </para>
114
115 <para condition="html" role="usernotes">User Notes:
116 <ulink url="&blfs-wiki;/dbus"/>
117 </para>
118 </sect2>
119
120 <sect2 role="installation">
121 <title>Installation of D-Bus</title>
122
123 <para revision="sysv">
124 If they do not already exist,
125 as the <systemitem class="username">root</systemitem> user, create a
126 system user and group to handle the system message bus activity:
127 </para>
128
129<screen role="root" revision="sysv"><userinput>groupadd -g 18 messagebus &amp;&amp;
130useradd -c "D-Bus Message Daemon User" -d /var/run/dbus \
131 -u 18 -g messagebus -s /bin/false messagebus</userinput></screen>
132
133 <para>
134 Install <application>D-Bus</application> by running the following
135 commands (you may wish to review the output from <command>./configure
136 --help</command> first and add any desired parameters to the
137 <command>configure</command> command shown below):
138 </para>
139
140<screen revision="sysv"><userinput>./configure --prefix=/usr \
141 --sysconfdir=/etc \
142 --localstatedir=/var \
143 --disable-doxygen-docs \
144 --disable-xml-docs \
145 --disable-static \
146 --disable-systemd \
147 --without-systemdsystemunitdir \
148 --with-console-auth-dir=/run/console/ \
149 --docdir=/usr/share/doc/dbus-&dbus-version; &amp;&amp;
150make</userinput></screen>
151
152<screen revision="systemd"><userinput>./configure --prefix=/usr \
153 --sysconfdir=/etc \
154 --localstatedir=/var \
155 --disable-doxygen-docs \
156 --disable-xml-docs \
157 --disable-static \
158 --with-console-auth-dir=/run/console/ \
159 --docdir=/usr/share/doc/dbus-&dbus-version; &amp;&amp;
160make</userinput></screen>
161
162 <para>
163 See below for test instructions.
164 </para>
165
166 <warning revision="systemd">
167 <para>
168 Installing the package will override all files installed by
169 <application>D-Bus</application> in LFS. It is critical that
170 nothing uses <application>D-Bus</application> libraries or
171 programs during the installation. The best way to ensure that these
172 libraries are not being used is to run the installation in rescue mode.
173 To switch to rescue mode, run the following command as the
174 <systemitem class="username">root</systemitem> user (from a TTY):
175 </para>
176
177<screen role="root"><userinput>systemctl start rescue.target</userinput></screen>
178
179 </warning>
180
181 <para>
182 Now, as the <systemitem class="username">root</systemitem> user:
183 </para>
184
185<screen role="root"><userinput>make install</userinput></screen>
186
187 <para>
188 If you are using a DESTDIR install,
189 <command>dbus-daemon-launch-helper</command> needs to be fixed
190 afterwards. Issue, as <systemitem class="username">root</systemitem>
191 user:
192 </para>
193
194<screen role="root"><userinput>chown -v root:messagebus /usr/libexec/dbus-daemon-launch-helper &amp;&amp;
195chmod -v 4750 /usr/libexec/dbus-daemon-launch-helper</userinput></screen>
196
197 <para>
198 If you are still building your system in chroot or you did not start the
199 daemon yet, but you want to compile some packages that require
200 <application>D-Bus</application>, generate
201 <application>D-Bus</application> UUID to avoid warnings when compiling
202 some packages with the following command as the
203 <systemitem class="username">root</systemitem> user:
204 </para>
205
206<screen role="root"><userinput>dbus-uuidgen --ensure</userinput></screen>
207
208 <para revision="systemd">
209 If not in chroot, at this point, you should reload the systemd daemon,
210 and reenter multi-user mode with the following commands (as the
211 <systemitem class="username">root</systemitem> user):
212 </para>
213
214<screen role="root" revision="systemd"><userinput>systemctl daemon-reload
215systemctl start multi-user.target</userinput></screen>
216
217 <para>
218 The dbus tests cannot be run until after <xref linkend="dbus-glib"/> has
219 been installed. They must be run as an unprivileged user from a local
220 session with bus address. Tests fail through ssh. If you want to run only
221 the unit tests, replace, below, <parameter>--enable-tests</parameter> by
222 <parameter>--enable-embedded-tests</parameter>, otherwise, <xref
223 linkend="dbus-python"/> has to be installed, before. The tests require
224 passing additional parameters to <command>configure</command> and
225 exposing additional functionality in the binaries. These interfaces are
226 not intended to be used in a production build of
227 <application>D-Bus</application>. If you would like to run the tests,
228 issue the following commands (for the tests, you don't need to build the
229 docs):
230 </para>
231
232<screen><userinput>make distclean &amp;&amp;
233./configure --enable-tests \
234 --enable-asserts \
235 --disable-doxygen-docs \
236 --disable-xml-docs &amp;&amp;
237make &amp;&amp;
238make check</userinput></screen>
239
240 <para>
241 The <quote>estimated disk space required</quote> reported above is
242 obtained in a build using the switches disabling documents generation.
243 This and the use of the <command>make distclean</command> command implies
244 that the build directory size is smaller than the one for a full build
245 with documents generated. There are two errors, for unknown reasons.
246 </para>
247<!--
248 <para>
249 If <command>run-test.sh</command> fails, it can be disabled with the
250 following sed, before running the commands for the tests:
251 </para>
252
253<screen><userinput>sed -i -e 's:run-test.sh:$(NULL):g' test/name-test/Makefile.in</userinput></screen>-->
254
255 <para>
256 There has been a report that the tests may fail if running inside a
257 Midnight Commander shell. You may get out-of-memory error messages when
258 running the tests. These are normal and can be safely ignored.
259 </para>
260
261 </sect2>
262
263 <sect2 role="commands">
264 <title>Command Explanations</title>
265
266 <para>
267 <parameter>--disable-doxygen-docs</parameter>: This switch disables
268 doxygen documentation build and install, if you have
269 <application>doxygen</application> installed. If
270 <application>doxygen</application> is installed, and you wish to build
271 them, remove this parameter.
272 </para>
273
274 <para>
275 <parameter>--disable-xml-docs</parameter>: This switch disables html
276 documentation build and install, if you have
277 <application>xmlto</application> installed. If
278 <application>xmlto</application> is installed, and you wish to build
279 them, remove this parameter.
280 </para>
281
282 <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
283 href="../../xincludes/static-libraries.xml"/>
284
285 <para revision="sysv">
286 <parameter>--disable-systemd</parameter>: This switch disables systemd
287 support in <application>D-Bus</application>.
288 </para>
289
290 <para revision="sysv">
291 <parameter>--without-systemdsystemunitdir</parameter>: This switch
292 prevents installation of systemd unit files.
293 </para>
294
295 <para>
296 <parameter>--with-console-auth-dir=/run/console/</parameter>: This
297 parameter specifies location of the
298 <application>ConsoleKit</application> auth dir.
299 </para>
300
301 <para>
302 <parameter>--enable-tests</parameter>: Build extra parts of the code to
303 support all tests. Configure will end with a NOTE warning about increased
304 size of libraries and decreased security.
305 </para>
306
307 <para>
308 <parameter>--enable-embedded-tests</parameter>: Build extra parts of the
309 code to support only unit tests. Configure will end with a NOTE warning
310 about increased size of libraries and decreased security.
311 </para>
312
313 <para>
314 <parameter>--enable-asserts</parameter>: Enable debugging code to run
315 assertions for statements normally assumed to be true. This prevents a
316 warning that '<parameter>--enable-tests</parameter>' on its own is only
317 useful for profiling and might not give true results for all tests, but
318 adds its own NOTE that this should not be used in a production build.
319 </para>
320
321 </sect2>
322
323 <sect2 role="configuration">
324 <title>Configuring D-Bus</title>
325
326 <sect3 id="dbus-config">
327 <title>Config Files</title>
328
329 <para>
330 <filename>/etc/dbus-1/session.conf</filename>,
331 <filename>/etc/dbus-1/system.conf</filename> and
332 <filename>/etc/dbus-1/system.d/*</filename>
333 </para>
334
335 <indexterm zone="dbus dbus-config">
336 <primary sortas="e-etc-dbus-1-session.conf">/etc/dbus-1/session.conf</primary>
337 </indexterm>
338
339 <indexterm zone="dbus dbus-config">
340 <primary sortas="e-etc-dbus-1/system.conf">/etc/dbus-1/system.conf</primary>
341 </indexterm>
342
343 <indexterm zone="dbus dbus-config">
344 <primary sortas="e-etc-dbus-1-system.d-star">/etc/dbus-1/system.d/*</primary>
345 </indexterm>
346
347 </sect3>
348
349 <sect3 id="dbus-session-config" xreflabel="D-Bus custom services directory">
350 <title>Configuration Information</title>
351
352 <para>
353 The configuration files listed above should probably not be
354 modified. If changes are required, you should create
355 <filename>/etc/dbus-1/session-local.conf</filename> and/or
356 <filename>/etc/dbus-1/system-local.conf</filename> and make any
357 desired changes to these files.
358 </para>
359
360 <para>
361 If any packages install a
362 <application>D-Bus</application> <filename>.service</filename>
363 file outside of the standard <filename
364 class="directory">/usr/share/dbus-1/services</filename> directory,
365 that directory should be added to the local session configuration.
366 For instance, <filename
367 class="directory">/usr/local/share/dbus-1/services</filename> can
368 be added by performing the following commands as the
369 <systemitem class="username">root</systemitem> user:
370 </para>
371
372<screen role="root"><userinput>cat &gt; /etc/dbus-1/session-local.conf &lt;&lt; "EOF"
373<literal>&lt;!DOCTYPE busconfig PUBLIC
374 "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
375 "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd"&gt;
376&lt;busconfig&gt;
377
378 &lt;!-- Search for .service files in /usr/local --&gt;
379 &lt;servicedir&gt;/usr/local/share/dbus-1/services&lt;/servicedir&gt;
380
381&lt;/busconfig&gt;</literal>
382EOF</userinput></screen>
383
384 </sect3>
385
386 <sect3 id="dbus-session">
387 <title>D-Bus Session Daemon</title>
388
389 <para revision="sysv">
390 To automatically start <command>dbus-daemon</command> when the
391 system is rebooted, install the
392 <filename>/etc/rc.d/init.d/dbus</filename> bootscript from the
393 <xref linkend="bootscripts"/> package.
394 </para>
395
396 <indexterm zone="dbus dbus-session" revision="sysv">
397 <primary sortas="f-dbus">dbus</primary>
398 </indexterm>
399
400<screen role="root" revision="sysv"><userinput>make install-dbus</userinput></screen>
401
402 <para revision="sysv">
403 Note that this boot script only starts the system-wide
404 <application>D-Bus</application> daemon. Each user requiring access to
405 <application>D-Bus</application> services will also need to run a
406 session daemon as well. There are many methods you can use to start a
407 session daemon using the <command>dbus-launch</command> command. Review
408 the <command>dbus-launch</command> man page for details about the
409 available parameters and options. Here are some suggestions and
410 examples:
411 </para>
412
413 <para revision="systemd">
414 There are many methods you can use to start a session daemon
415 using the <command>dbus-launch</command> command. Review the
416 <command>dbus-launch</command> man page for details about the
417 available parameters and options. Here are some suggestions and
418 examples:
419 </para>
420
421
422 <itemizedlist spacing="compact">
423 <listitem>
424 <para>
425 Add <command>dbus-launch</command> to the line in the
426 <filename>~/.xinitrc</filename> file that starts your graphical
427 desktop environment.
428 </para>
429 </listitem>
430 <listitem>
431 <para>
432 If you use <command>xdm</command> or some other display manager
433 that calls the <filename>~/.xsession</filename> file, you can add
434 <command>dbus-launch</command> to the line in your
435 <filename>~/.xsession</filename> file that starts your graphical
436 desktop environment. The syntax would be similar to the example in
437 the <filename>~/.xinitrc</filename> file.
438 </para>
439 </listitem>
440 <listitem>
441 <para>
442 The examples shown previously use
443 <command>dbus-launch</command> to specify a program to be run. This
444 has the benefit (when also using the
445 <parameter>--exit-with-session</parameter> parameter) of stopping the
446 session daemon when the specified program is stopped. You can also
447 start the session daemon in your system or personal startup scripts
448 by adding the following lines:
449 </para>
450
451<screen><userinput><literal># Start the D-Bus session daemon
452eval `dbus-launch`
453export DBUS_SESSION_BUS_ADDRESS</literal></userinput></screen>
454
455 <para>
456 This method will not stop the session daemon when you exit
457 your shell, therefore you should add the following line to your
458 <filename>~/.bash_logout</filename> file:
459 </para>
460
461<screen><userinput><literal># Kill the D-Bus session daemon
462kill $DBUS_SESSION_BUS_PID</literal></userinput></screen>
463 </listitem>
464
465 <listitem>
466 <para>
467 A hint has been written that provides ways to start scripts
468 using the KDM session manager of KDE. The concepts in this hint could
469 possibly be used with other session managers as well. The hint is
470 located at <ulink
471 url="&hints-root;/downloads/files/execute-session-scripts-using-kdm.txt"/>.
472 </para>
473 </listitem>
474
475 </itemizedlist>
476
477 </sect3>
478
479 </sect2>
480
481 <sect2 role="content" revision="sysv">
482 <title>Contents</title>
483
484 <segmentedlist>
485 <segtitle>Installed Programs</segtitle>
486 <segtitle>Installed Library</segtitle>
487 <segtitle>Installed Directories</segtitle>
488
489 <seglistitem>
490 <seg>
491 dbus-cleanup-sockets, dbus-daemon, dbus-launch, dbus-monitor,
492 dbus-run-session, dbus-send, dbus-test-tool,
493 dbus-update-activation-environment, and dbus-uuidgen
494 </seg>
495 <seg>
496 libdbus-1.so
497 </seg>
498 <seg>
499 /etc/dbus-1,
500 /usr/{include,lib}/dbus-1.0,
501 /usr/share/dbus-1,
502 /usr/share/doc/dbus-&dbus-version;, and
503 /var/{lib,run}/dbus
504 </seg>
505 </seglistitem>
506 </segmentedlist>
507
508 <variablelist>
509 <bridgehead renderas="sect3">Short Descriptions</bridgehead>
510 <?dbfo list-presentation="list"?>
511 <?dbhtml list-presentation="table"?>
512
513 <varlistentry id="dbus-cleanup-sockets">
514 <term><command>dbus-cleanup-sockets</command></term>
515 <listitem>
516 <para>
517 is used to clean up leftover sockets in a directory.
518 </para>
519 <indexterm zone="dbus dbus-cleanup-sockets">
520 <primary sortas="b-dbus-cleanup-sockets">dbus-cleanup-sockets</primary>
521 </indexterm>
522 </listitem>
523 </varlistentry>
524
525 <varlistentry id="dbus-daemon">
526 <term><command>dbus-daemon</command></term>
527 <listitem>
528 <para>
529 is the <application>D-Bus</application> message bus daemon.
530 </para>
531 <indexterm zone="dbus dbus-daemon">
532 <primary sortas="b-dbus-daemon">dbus-daemon</primary>
533 </indexterm>
534 </listitem>
535 </varlistentry>
536
537 <varlistentry id="dbus-launch">
538 <term><command>dbus-launch</command></term>
539 <listitem>
540 <para>
541 is used to start <command>dbus-daemon</command> from a shell
542 script. It would normally be called from a user's login
543 scripts.
544 </para>
545 <indexterm zone="dbus dbus-launch">
546 <primary sortas="b-dbus-launch">dbus-launch</primary>
547 </indexterm>
548 </listitem>
549 </varlistentry>
550
551 <varlistentry id="dbus-monitor">
552 <term><command>dbus-monitor</command></term>
553 <listitem>
554 <para>
555 is used to monitor messages going through a
556 <application>D-Bus</application> message bus.
557 </para>
558 <indexterm zone="dbus dbus-monitor">
559 <primary sortas="b-dbus-monitor">dbus-monitor</primary>
560 </indexterm>
561 </listitem>
562 </varlistentry>
563
564 <varlistentry id="dbus-run-session">
565 <term><command>dbus-run-session</command></term>
566 <listitem>
567 <para>
568 start a process as a new <application>D-Bus</application> session.
569 </para>
570 <indexterm zone="dbus dbus-run-session">
571 <primary sortas="b-dbus-run-session">dbus-run-session</primary>
572 </indexterm>
573 </listitem>
574 </varlistentry>
575
576 <varlistentry id="dbus-send">
577 <term><command>dbus-send</command></term>
578 <listitem>
579 <para>
580 is used to send a message to a <application>D-Bus</application>
581 message bus.
582 </para>
583 <indexterm zone="dbus dbus-send">
584 <primary sortas="b-dbus-send">dbus-send</primary>
585 </indexterm>
586 </listitem>
587 </varlistentry>
588
589 <varlistentry id="dbus-test-tool">
590 <term><command>dbus-test-tool</command></term>
591 <listitem>
592 <para>
593 <application>D-Bus</application> traffic generator and test tool; it
594 is a multi-purpose tool for debugging and profiling
595 <application>D-Bus</application>.
596 </para>
597 <indexterm zone="dbus dbus-test-tool">
598 <primary sortas="b-dbus-test-tool">dbus-test-tool</primary>
599 </indexterm>
600 </listitem>
601 </varlistentry>
602
603 <varlistentry id="dbus-update-activation-environment">
604 <term><command>dbus-update-activation-environment</command></term>
605 <listitem>
606 <para>
607 update environment used for <application>D-Bus</application> session
608 services; it updates the list of environment variables used by
609 <command>dbus-daemon --session</command> when it activates session
610 services without using systemd.
611 </para>
612 <indexterm zone="dbus dbus-update-activation-environment">
613 <primary sortas="b-dbus-update-activation-environment">
614 dbus-update-activation-environment</primary>
615 </indexterm>
616 </listitem>
617 </varlistentry>
618
619 <varlistentry id="dbus-uuidgen">
620 <term><command>dbus-uuidgen</command></term>
621 <listitem>
622 <para>
623 is used to generate a universally unique ID.
624 </para>
625 <indexterm zone="dbus dbus-uuidgen">
626 <primary sortas="b-dbus-uuidgen">dbus-uuidgen</primary>
627 </indexterm>
628 </listitem>
629 </varlistentry>
630
631 <varlistentry id="libdbus-1">
632 <term><filename class="libraryfile">libdbus-1.so</filename></term>
633 <listitem>
634 <para>
635 contains the API functions used by the
636 <application>D-Bus</application> message daemon.
637 <application>D-Bus</application> is first a library that provides
638 one-to-one communication between any two applications;
639 <command>dbus-daemon</command> is an application that uses this
640 library to implement a message bus daemon.
641 </para>
642 <indexterm zone="dbus libdbus-1">
643 <primary sortas="c-libdbus-1">libdbus-1.so</primary>
644 </indexterm>
645 </listitem>
646 </varlistentry>
647
648 </variablelist>
649
650 </sect2>
651
652 <sect2 role="content" revision="systemd">
653 <title>Contents</title>
654
655 <para>
656 A list of the installed files, along with their short
657 descriptions can be found at
658 <ulink url="&lfs-root;/chapter06/dbus.html#contents-dbus"/>.
659 </para>
660
661 </sect2>
662
663
664</sect1>
665
Note: See TracBrowser for help on using the repository browser.