source: general/sysutils/dbus.xml@ 5c9e998

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 5c9e998 was 5c9e998, checked in by DJ Lucas <dj@…>, 8 years ago

Merge D-Bus changes frome systemd branch, some temporary fixes for bootscript related render errors.

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

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