source: general/sysutils/dbus.xml@ 784ec394

10.0 10.1 11.0 11.1 11.2 11.3 12.0 12.1 12.2 7.10 7.4 7.5 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 gimp3 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/for-12.3 xry111/intltool xry111/llvm18 xry111/soup3 xry111/spidermonkey128 xry111/test-20220226 xry111/xf86-video-removal
Last change on this file since 784ec394 was 406fc62, checked in by Ragnar Thomsen <rthomsen@…>, 12 years ago

D-Bus GLib Bindings 0.100

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

  • Property mode set to 100644
File size: 16.5 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 " ">
[02e742b]9 <!ENTITY dbus-md5sum "16dcae2dd0c76e398381601ac9acdec4">
[b6a2a0e]10 <!ENTITY dbus-size "1.8 MB">
[02e742b]11 <!ENTITY dbus-buildsize "29 MB">
[b6a2a0e]12 <!ENTITY dbus-time "0.5 SBU">
[e8e3312d]13]>
14
[02e742b]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
[02e742b]23 <title>D-Bus-&dbus-version;</title>
[e8e3312d]24
25 <indexterm zone="dbus">
[02e742b]26 <primary sortas="a-D-Bus">D-Bus</primary>
[e8e3312d]27 </indexterm>
28
29 <sect2 role="package">
[02e742b]30 <title>Introduction to D-Bus</title>
[e8e3312d]31
[02e742b]32 <para><application>D-Bus</application> is a message bus system, a simple
[e8e3312d]33 way for applications to talk to one another.
[02e742b]34 <application>D-Bus</application> supplies both a system daemon (for events
[e8e3312d]35 such as <quote>new hardware device added</quote> or <quote>printer queue
36 changed</quote>) and a per-user-login-session daemon (for general IPC needs
37 among user applications). Also, the message bus is built on top of a
38 general one-to-one message passing framework, which can be used by any two
39 applications to communicate directly (without going through the message bus
40 daemon).</para>
41
[4c77a949]42 &lfs71_checked;
[482477c]43
[e8e3312d]44 <bridgehead renderas="sect3">Package Information</bridgehead>
45 <itemizedlist spacing="compact">
46 <listitem>
47 <para>Download (HTTP): <ulink url="&dbus-download-http;"/></para>
48 </listitem>
49 <listitem>
50 <para>Download (FTP): <ulink url="&dbus-download-ftp;"/></para>
51 </listitem>
52 <listitem>
53 <para>Download MD5 sum: &dbus-md5sum;</para>
54 </listitem>
55 <listitem>
56 <para>Download size: &dbus-size;</para>
57 </listitem>
58 <listitem>
59 <para>Estimated disk space required: &dbus-buildsize;</para>
60 </listitem>
61 <listitem>
62 <para>Estimated build time: &dbus-time;</para>
63 </listitem>
64 </itemizedlist>
65
[02e742b]66 <bridgehead renderas="sect3">D-Bus Dependencies</bridgehead>
[e8e3312d]67
[bf325a39]68 <bridgehead renderas="sect4">Required</bridgehead>
[b6a2a0e]69 <para role="required">
70 <xref linkend="expat"/> (preferred) or
71 <xref linkend="libxml2"/>
72 </para>
[bf325a39]73
[adfdc8b]74 <bridgehead renderas="sect4">Recommended</bridgehead>
75 <para role="recommended"><xref linkend="xorg7-lib"/>
76 (for <command>dbus-launch</command> program)</para>
77
[e8e3312d]78 <bridgehead renderas="sect4">Optional</bridgehead>
[b6a2a0e]79 <para role="optional">
[d6341da]80 <xref linkend="dbus-glib"/> (to run tests),
81 <xref linkend="python2"/> (to run tests) and
[b6a2a0e]82 <xref linkend="doxygen"/> (to generate the API documentation)
83 </para>
[6e13117a]84
85 <para>Note that the <command>configure</command> script will look for
[6129b81]86 <xref linkend="xmlto"/> but it does nothing as the XML/HTML documentation is
87 already shipped in the source tree.</para>
[c45cb57]88
[1039de3]89 <para condition="html" role="usernotes">User Notes:
90 <ulink url="&blfs-wiki;/dbus"/></para>
91
[e8e3312d]92 </sect2>
93
94 <sect2 role="kernel" id='dbus-kernel'>
95 <title>Kernel Configuration</title>
96
97 <para>Ensure the following option is enabled in the kernel configuration
98 and recompile the kernel if necessary:</para>
99
100<screen><literal>General Setup
101 System V IPC</literal></screen>
102
103 <indexterm zone="dbus dbus-kernel">
104 <primary sortas="d-dbus">dbus</primary>
105 </indexterm>
106
107 </sect2>
108
109 <sect2 role="installation">
[02e742b]110 <title>Installation of D-Bus</title>
[e8e3312d]111
112 <para>As the <systemitem class="username">root</systemitem> user, create a
113 system user and group to handle the system message bus activity:</para>
114
[b6a2a0e]115<screen role="root"><userinput>groupadd -g 18 messagebus &amp;&amp;
[02e742b]116useradd -c "D-Bus Message Daemon User" -d /var/run/dbus \
[b6a2a0e]117 -u 18 -g messagebus -s /bin/false messagebus</userinput></screen>
[cda0a69]118
[02e742b]119 <para>Install <application>D-Bus</application> by running the following
[e8e3312d]120 commands (you may wish to review the output from
121 <command>./configure --help</command> first and add any desired parameters
122 to the <command>configure</command> command shown below):</para>
123
[02e742b]124<screen><userinput>./configure --prefix=/usr \
125 --sysconfdir=/etc \
126 --libexecdir=/usr/lib/dbus-1.0 \
127 --localstatedir=/var \
128 --disable-static &amp;&amp;
[e8e3312d]129make</userinput></screen>
130
[b6a2a0e]131 <para>See below for test instructions.</para>
[c45cb57]132
[6e13117a]133 <para>Now, as the <systemitem class="username">root</systemitem>
134 user:</para>
[e8e3312d]135
136<screen role="root"><userinput>make install &amp;&amp;
[b6a2a0e]137mv -v /usr/share/doc/dbus /usr/share/doc/dbus-&dbus-version;</userinput></screen>
138
139 <para>The dbus tests cannot be run until after <xref linkend="dbus-glib"/>
140 has been installed. The tests require passing additional parameters to
141 <command>configure</command> and exposing additional functionality in the
142 binaries. These interfaces are not intended to be used in a production
[02e742b]143 build of <application>D-Bus</application>. If you would like to run the
[b6a2a0e]144 unit tests, issue the following commands:</para>
145
146<screen><userinput>make distclean &amp;&amp;
147./configure --enable-tests --enable-asserts &amp;&amp;
148make &amp;&amp;
149make check &amp;&amp;
150make distclean</userinput></screen>
[c45cb57]151
[b6a2a0e]152 <para>Note there has been a report that the tests may fail if running
[d6341da]153 inside a Midnight Commander shell.
154 You may get out-of-memory error messages when running the tests.
155 These are normal and can be safely ignored.</para>
[e8e3312d]156
157 </sect2>
158
159 <sect2 role="commands">
160 <title>Command Explanations</title>
161
[2fdcd9df]162 <para><parameter>--libexecdir=/usr/lib/dbus-1.0</parameter>: This will
[6e13117a]163 install binaries meant to be only used internally by
[02e742b]164 <application>D-Bus</application>, and the directory
[6e13117a]165 <filename class="directory">dbus-1</filename> into
[da167e4]166 <filename class="directory">/usr/lib/dbus-1.0</filename> instead of
167 into <filename class="directory">/usr/libexec</filename>.</para>
168
[e8e3312d]169 <para><parameter>--localstatedir=/var</parameter>: This parameter causes
[bf325a39]170 the daemon PID file, system bus socket and machine uuid file to be
171 created in the <filename class="directory">/var</filename> directory
172 instead of the <filename class="directory">/usr/var</filename>
173 directory.</para>
[aa5632c]174
[30d0aef]175 <para><parameter>--enable-tests</parameter>: Build extra parts of the code
176 to support testing. Configure will end with a NOTE warning about this.</para>
177
178 <para><parameter>--enable-asserts</parameter>: Enable debugging code to run
179 assertions for statements normally assumed to be true. This prevents a
180 warning that '<parameter>--enable-tests</parameter>' on its own is only useful
181 for profiling and might not give true results for all tests, but adds its own
182 NOTE that this should not be used in a production build.
183 </para>
184
[2fdcd9df]185 <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
186 href="../../xincludes/static-libraries.xml"/>
[30d0aef]187
[e8e3312d]188 </sect2>
189
190 <sect2 role="configuration">
191 <title>Configuring dbus</title>
192
193 <sect3 id="dbus-config">
194 <title>Config Files</title>
195 <para><filename>/etc/dbus-1/session.conf</filename>,
196 <filename>/etc/dbus-1/system.conf</filename> and
[c45cb57]197 <filename>/etc/dbus-1/system.d/*</filename></para>
[e8e3312d]198
199 <indexterm zone="dbus dbus-config">
200 <primary sortas="e-etc-dbus-1-session.conf">/etc/dbus-1/session.conf</primary>
201 </indexterm>
202
203 <indexterm zone="dbus dbus-config">
204 <primary sortas="e-etc-dbus-1/system.conf">/etc/dbus-1/system.conf</primary>
205 </indexterm>
206
207 <indexterm zone="dbus dbus-config">
[c45cb57]208 <primary sortas="e-etc-dbus-1-system.d-star">/etc/dbus-1/system.d/*</primary>
[e8e3312d]209 </indexterm>
210
211 </sect3>
212
[e9efab0b]213 <sect3 id="dbus-session-config" xreflabel="D-Bus custom services directory">
214 <title>Configuration Information</title>
[e8e3312d]215
216 <para>The configuration files listed above should probably not be
217 modified. If changes are required, you should create
218 <filename>/etc/dbus-1/session-local.conf</filename> and/or
[bccbdaea]219 <filename>/etc/dbus-1/system-local.conf</filename> and make any
[e8e3312d]220 desired changes to these files.</para>
221
[57aa7a28]222 <para>If any packages install a
223 <application>D-Bus</application> <filename>.service</filename>
224 file outside of the standard <filename
225 class="directory">/usr/share/dbus-1/services</filename> directory,
226 that directory should be added to the local session configuration.
227 For instance, <filename
228 class="directory">/usr/local/share/dbus-1/services</filename> can
229 be added by performing the following commands as the
230 <systemitem class="username">root</systemitem> user:</para>
231
232<screen role="root"><userinput>cat &gt; /etc/dbus-1/session-local.conf &lt;&lt; "EOF"
233<literal>&lt;!DOCTYPE busconfig PUBLIC
234 "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
235 "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd"&gt;
236&lt;busconfig&gt;
237
238 &lt;!-- Search for .service files in /usr/local --&gt;
239 &lt;servicedir&gt;/usr/local/share/dbus-1/services&lt;/servicedir&gt;
240
241&lt;/busconfig&gt;</literal>
242EOF</userinput></screen>
243
[e8e3312d]244 </sect3>
245
246 <sect3 id="dbus-init">
247 <title>Boot Script</title>
248
249 <para>To automatically start <command>dbus-daemon</command> when the
250 system is rebooted, install the
251 <filename>/etc/rc.d/init.d/dbus</filename> bootscript from the
[5254d12]252 <xref linkend="bootscripts"/> package.</para>
[e8e3312d]253
254 <indexterm zone="dbus dbus-init">
255 <primary sortas="f-dbus">dbus</primary>
256 </indexterm>
257
258<screen role="root"><userinput>make install-dbus</userinput></screen>
259
[3565e02]260 <para>Note that this boot script only starts the system-wide
[02e742b]261 <application>D-Bus</application> daemon. Each user requiring access to
262 <application>D-Bus</application> services will also need to run a
[3565e02]263 session daemon as well. There are many methods you can use to start a
264 session daemon using the <command>dbus-launch</command> command. Review
265 the <command>dbus-launch</command> man page for details about the
266 available parameters and options. Here are some suggestions and
267 examples:</para>
268
269 <itemizedlist spacing="compact">
270 <listitem>
271 <para>Add <command>dbus-launch</command> to the line in the
272 <filename>~/.xinitrc</filename> file that starts your graphical
[0e15d3a]273 desktop environment<!-- as shown in <xref linkend="gnome-config"/>-->.</para>
[3565e02]274 </listitem>
275 <listitem>
276 <para>If you use <command>xdm</command> or some other display manager
277 that calls the <filename>~/.xsession</filename> file, you can add
278 <command>dbus-launch</command> to the line in your
279 <filename>~/.xsession</filename> file that starts your graphical
280 desktop environment. The syntax would be similar to the example in
281 the <filename>~/.xinitrc</filename> file.</para>
282 </listitem>
[cfe2f1b6]283<!-- Enabled by default.
[3565e02]284 <listitem>
285 <para>If you use <command>gdm</command> or some other display manager
286 that utilizes custom files to initiate sessions, use the example in
287 <xref linkend="gdm-config-dbus"/> of the
288 <application>GDM</application> instructions to create a file
289 containing <command>dbus-launch</command>.</para>
[cfe2f1b6]290 </listitem>-->
[3565e02]291 <listitem>
292 <para>The examples shown previously use
293 <command>dbus-launch</command> to specify a program to be run. This
294 has the benefit (when also using the
295 <parameter>--exit-with-session</parameter> parameter) of stopping the
296 session daemon when the specified program is stopped. You can also
297 start the session daemon in your system or personal startup scripts
298 by adding the following lines:</para>
299
[02e742b]300<screen><userinput><literal># Start the D-Bus session daemon
[3565e02]301eval `dbus-launch`
302export DBUS_SESSION_BUS_ADDRESS</literal></userinput></screen>
303
304 <para>This method will not stop the session daemon when you exit
305 your shell, therefore you should add the following line to your
306 <filename>~/.bash_logout</filename> file:</para>
307
[02e742b]308<screen><userinput><literal># Kill the D-Bus session daemon
[3565e02]309kill $DBUS_SESSION_BUS_PID</literal></userinput></screen>
[bccbdaea]310 </listitem>
[4ec808b]311
[3565e02]312 <listitem>
[c45cb57]313 <para>A hint has been written that provides ways to start scripts
314 using the KDM session manager of KDE. The concepts in this hint could
[7712824]315 possibly be used with other session managers as well. The hint is
[c45cb57]316 located at <ulink
317 url="&hints-root;/downloads/files/execute-session-scripts-using-kdm.txt"/>.
318 </para>
[3565e02]319 </listitem>
[c45cb57]320
[3565e02]321 </itemizedlist>
322
[e8e3312d]323 </sect3>
324
325 </sect2>
326
327 <sect2 role="content">
328 <title>Contents</title>
329
330 <segmentedlist>
331 <segtitle>Installed Programs</segtitle>
[02e742b]332 <segtitle>Installed Libraries</segtitle>
[e8e3312d]333 <segtitle>Installed Directories</segtitle>
334
335 <seglistitem>
[02e742b]336 <seg>dbus-cleanup-sockets, dbus-daemon, dbus-launch, dbus-monitor,
337 dbus-send and dbus-uuidgen</seg>
338 <seg>libdbus-1.so</seg>
339 <seg>/etc/dbus-1, /usr/include/dbus-1.0, /usr/lib/dbus-1.0,
340 /usr/share/dbus-1, /usr/share/doc/dbus-1.6.0 and /var/run/dbus</seg>
[e8e3312d]341 </seglistitem>
342 </segmentedlist>
343
344 <variablelist>
345 <bridgehead renderas="sect3">Short Descriptions</bridgehead>
346 <?dbfo list-presentation="list"?>
347 <?dbhtml list-presentation="table"?>
348
349 <varlistentry id="dbus-cleanup-sockets">
350 <term><command>dbus-cleanup-sockets</command></term>
351 <listitem>
352 <para>is used to clean up leftover sockets in a directory.</para>
353 <indexterm zone="dbus dbus-cleanup-sockets">
354 <primary sortas="b-dbus-cleanup-sockets">dbus-cleanup-sockets</primary>
355 </indexterm>
356 </listitem>
357 </varlistentry>
358
359 <varlistentry id="dbus-daemon">
360 <term><command>dbus-daemon</command></term>
361 <listitem>
[02e742b]362 <para>is the <application>D-Bus</application> message bus
[e8e3312d]363 daemon.</para>
364 <indexterm zone="dbus dbus-daemon">
365 <primary sortas="b-dbus-daemon">dbus-daemon</primary>
366 </indexterm>
367 </listitem>
368 </varlistentry>
369
370 <varlistentry id="dbus-launch">
371 <term><command>dbus-launch</command></term>
372 <listitem>
373 <para>is used to start <command>dbus-daemon</command> from a shell
374 script. It would normally be called from a user's login
375 scripts.</para>
376 <indexterm zone="dbus dbus-launch">
377 <primary sortas="b-dbus-launch">dbus-launch</primary>
378 </indexterm>
379 </listitem>
380 </varlistentry>
381
382 <varlistentry id="dbus-monitor">
383 <term><command>dbus-monitor</command></term>
384 <listitem>
385 <para>is used to monitor messages going through a
[02e742b]386 <application>D-Bus</application> message bus.</para>
[e8e3312d]387 <indexterm zone="dbus dbus-monitor">
388 <primary sortas="b-dbus-monitor">dbus-monitor</primary>
389 </indexterm>
390 </listitem>
391 </varlistentry>
392
393 <varlistentry id="dbus-send">
394 <term><command>dbus-send</command></term>
395 <listitem>
[02e742b]396 <para>is used to send a message to a <application>D-Bus</application>
[e8e3312d]397 message bus.</para>
398 <indexterm zone="dbus dbus-send">
399 <primary sortas="b-dbus-send">dbus-send</primary>
400 </indexterm>
401 </listitem>
402 </varlistentry>
403
[bf325a39]404 <varlistentry id="dbus-uuidgen">
405 <term><command>dbus-uuidgen</command></term>
[e8e3312d]406 <listitem>
[bf325a39]407 <para>is used to generate or read a universally unique ID.</para>
408 <indexterm zone="dbus dbus-uuidgen">
409 <primary sortas="b-dbus-uuidgen">dbus-uuidgen</primary>
[e8e3312d]410 </indexterm>
411 </listitem>
412 </varlistentry>
413
414 <varlistentry id="libdbus-1">
[02e742b]415 <term><filename class='libraryfile'>libdbus-1.so</filename></term>
[e8e3312d]416 <listitem>
417 <para>contains the API functions used by the
[02e742b]418 <application>D-Bus</application> message daemon.
419 <application>D-Bus</application> is first a library that provides
[e8e3312d]420 one-to-one communication between any two applications;
421 <command>dbus-daemon</command> is an application that uses this
422 library to implement a message bus daemon.</para>
423 <indexterm zone="dbus libdbus-1">
[406fc62]424 <primary sortas="c-libdbus-1">libdbus-1.so</primary>
[e8e3312d]425 </indexterm>
426 </listitem>
427 </varlistentry>
428
429 </variablelist>
430
431 </sect2>
432
433</sect1>
Note: See TracBrowser for help on using the repository browser.