source: general/sysutils/dbus.xml@ 4ef4636b

elogind
Last change on this file since 4ef4636b was 4ef4636b, checked in by DJ Lucas <dj@…>, 5 years ago

Initial commit of elogind-239.3. Adjust serveral packages to utilize elogind.

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

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