source: general/sysutils/dbus.xml@ d6341da

10.0 10.1 11.0 11.1 11.2 11.3 12.0 12.1 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 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 d6341da was d6341da, checked in by Ragnar Thomsen <rthomsen@…>, 12 years ago

python dep. for dbus

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

  • Property mode set to 100644
File size: 16.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 "5944f93b194ce93d4c88142fc0e6b94b">
10 <!ENTITY dbus-size "1.8 MB">
11 <!ENTITY dbus-buildsize "100 MB">
12 <!ENTITY dbus-time "0.5 SBU">
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><application>D-BUS</application> is a message bus system, a simple
33 way for applications to talk to one another.
34 <application>D-BUS</application> supplies both a system daemon (for events
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
42 &lfs71_checked;
43
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
66 <bridgehead renderas="sect3">D-BUS Dependencies</bridgehead>
67
68 <bridgehead renderas="sect4">Required</bridgehead>
69 <para role="required">
70 <xref linkend="expat"/> (preferred) or
71 <xref linkend="libxml2"/>
72 </para>
73
74 <bridgehead renderas="sect4">Recommended</bridgehead>
75 <para role="recommended"><xref linkend="xorg7-lib"/>
76 (for <command>dbus-launch</command> program)</para>
77
78 <bridgehead renderas="sect4">Optional</bridgehead>
79 <para role="optional">
80 <xref linkend="dbus-glib"/> (to run tests),
81 <xref linkend="python2"/> (to run tests) and
82 <xref linkend="doxygen"/> (to generate the API documentation)
83 </para>
84
85 <para>Note that the <command>configure</command> script will look for
86 <xref linkend="xmlto"/> but it does nothing as the XML/HTML documentation is
87 already shipped in the source tree.</para>
88
89 <para condition="html" role="usernotes">User Notes:
90 <ulink url="&blfs-wiki;/dbus"/></para>
91
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">
110 <title>Installation of D-BUS</title>
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
115<screen role="root"><userinput>groupadd -g 18 messagebus &amp;&amp;
116useradd -c "D-BUS Message Daemon User" -d /var/lib/dbus \
117 -u 18 -g messagebus -s /bin/false messagebus</userinput></screen>
118
119 <para>Install <application>D-BUS</application> by running the following
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
124<screen><userinput>sed "s@test_refs_LDADD =@&amp; -lgthread-2.0@" -i test/Makefile.in &amp;&amp;
125./configure --prefix=/usr \
126 --sysconfdir=/etc \
127 --libexecdir=/usr/lib/dbus-1.0 \
128 --localstatedir=/var &amp;&amp;
129make</userinput></screen>
130
131 <para>See below for test instructions.</para>
132
133 <para>Now, as the <systemitem class="username">root</systemitem>
134 user:</para>
135
136<screen role="root"><userinput>make install &amp;&amp;
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
143 build of <application>D-BUS</application>. If you would like to run the
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>
151
152 <para>Note there has been a report that the tests may fail if running
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>
156
157 </sect2>
158
159 <sect2 role="commands">
160 <title>Command Explanations</title>
161
162 <para><parameter>sed "s@test_refs_LDADD ..." -i test/Makefile.in</parameter>:
163 Adds missing library to linker command line for dbus test program.</para>
164
165 <para><parameter>--libexecdir=/usr/lib/dbus-1.0 </parameter>: This will
166 install binaries meant to be only used internally by
167 <application>D-BUS</application>, and the directory
168 <filename class="directory">dbus-1</filename> into
169 <filename class="directory">/usr/lib/dbus-1.0</filename> instead of
170 into <filename class="directory">/usr/libexec</filename>.</para>
171
172 <para><parameter>--localstatedir=/var</parameter>: This parameter causes
173 the daemon PID file, system bus socket and machine uuid file to be
174 created in the <filename class="directory">/var</filename> directory
175 instead of the <filename class="directory">/usr/var</filename>
176 directory.</para>
177
178 <para><parameter>--enable-tests</parameter>: Build extra parts of the code
179 to support testing. Configure will end with a NOTE warning about this.</para>
180
181 <para><parameter>--enable-asserts</parameter>: Enable debugging code to run
182 assertions for statements normally assumed to be true. This prevents a
183 warning that '<parameter>--enable-tests</parameter>' on its own is only useful
184 for profiling and might not give true results for all tests, but adds its own
185 NOTE that this should not be used in a production build.
186 </para>
187
188 <para><parameter>--disable-static</parameter>: Prevent the static libraries
189 being built and installed.</para>
190
191 </sect2>
192
193 <sect2 role="configuration">
194 <title>Configuring dbus</title>
195
196 <sect3 id="dbus-config">
197 <title>Config Files</title>
198 <para><filename>/etc/dbus-1/session.conf</filename>,
199 <filename>/etc/dbus-1/system.conf</filename> and
200 <filename>/etc/dbus-1/system.d/*</filename></para>
201
202 <indexterm zone="dbus dbus-config">
203 <primary sortas="e-etc-dbus-1-session.conf">/etc/dbus-1/session.conf</primary>
204 </indexterm>
205
206 <indexterm zone="dbus dbus-config">
207 <primary sortas="e-etc-dbus-1/system.conf">/etc/dbus-1/system.conf</primary>
208 </indexterm>
209
210 <indexterm zone="dbus dbus-config">
211 <primary sortas="e-etc-dbus-1-system.d-star">/etc/dbus-1/system.d/*</primary>
212 </indexterm>
213
214 </sect3>
215
216 <sect3 id="dbus-session-config" xreflabel="D-Bus custom services directory">
217 <title>Configuration Information</title>
218
219 <para>The configuration files listed above should probably not be
220 modified. If changes are required, you should create
221 <filename>/etc/dbus-1/session-local.conf</filename> and/or
222 <filename>/etc/dbus-1/system-local.conf</filename> and make any
223 desired changes to these files.</para>
224
225 <para>If any packages install a
226 <application>D-Bus</application> <filename>.service</filename>
227 file outside of the standard <filename
228 class="directory">/usr/share/dbus-1/services</filename> directory,
229 that directory should be added to the local session configuration.
230 For instance, <filename
231 class="directory">/usr/local/share/dbus-1/services</filename> can
232 be added by performing the following commands as the
233 <systemitem class="username">root</systemitem> user:</para>
234
235<screen role="root"><userinput>cat &gt; /etc/dbus-1/session-local.conf &lt;&lt; "EOF"
236<literal>&lt;!DOCTYPE busconfig PUBLIC
237 "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
238 "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd"&gt;
239&lt;busconfig&gt;
240
241 &lt;!-- Search for .service files in /usr/local --&gt;
242 &lt;servicedir&gt;/usr/local/share/dbus-1/services&lt;/servicedir&gt;
243
244&lt;/busconfig&gt;</literal>
245EOF</userinput></screen>
246
247 </sect3>
248
249 <sect3 id="dbus-init">
250 <title>Boot Script</title>
251
252 <para>To automatically start <command>dbus-daemon</command> when the
253 system is rebooted, install the
254 <filename>/etc/rc.d/init.d/dbus</filename> bootscript from the
255 <xref linkend="bootscripts"/> package.</para>
256
257 <indexterm zone="dbus dbus-init">
258 <primary sortas="f-dbus">dbus</primary>
259 </indexterm>
260
261<screen role="root"><userinput>make install-dbus</userinput></screen>
262
263 <para>Note that this boot script only starts the system-wide
264 <application>D-BUS</application> daemon. Each user requiring access to
265 <application>D-BUS</application> services will also need to run a
266 session daemon as well. There are many methods you can use to start a
267 session daemon using the <command>dbus-launch</command> command. Review
268 the <command>dbus-launch</command> man page for details about the
269 available parameters and options. Here are some suggestions and
270 examples:</para>
271
272 <itemizedlist spacing="compact">
273 <listitem>
274 <para>Add <command>dbus-launch</command> to the line in the
275 <filename>~/.xinitrc</filename> file that starts your graphical
276 desktop environment as shown in <xref linkend="gnome-config"/>.</para>
277 </listitem>
278 <listitem>
279 <para>If you use <command>xdm</command> or some other display manager
280 that calls the <filename>~/.xsession</filename> file, you can add
281 <command>dbus-launch</command> to the line in your
282 <filename>~/.xsession</filename> file that starts your graphical
283 desktop environment. The syntax would be similar to the example in
284 the <filename>~/.xinitrc</filename> file.</para>
285 </listitem>
286 <listitem>
287 <para>If you use <command>gdm</command> or some other display manager
288 that utilizes custom files to initiate sessions, use the example in
289 <xref linkend="gdm-config-dbus"/> of the
290 <application>GDM</application> instructions to create a file
291 containing <command>dbus-launch</command>.</para>
292 </listitem>
293 <listitem>
294 <para>The examples shown previously use
295 <command>dbus-launch</command> to specify a program to be run. This
296 has the benefit (when also using the
297 <parameter>--exit-with-session</parameter> parameter) of stopping the
298 session daemon when the specified program is stopped. You can also
299 start the session daemon in your system or personal startup scripts
300 by adding the following lines:</para>
301
302<screen><userinput><literal># Start the D-BUS session daemon
303eval `dbus-launch`
304export DBUS_SESSION_BUS_ADDRESS</literal></userinput></screen>
305
306 <para>This method will not stop the session daemon when you exit
307 your shell, therefore you should add the following line to your
308 <filename>~/.bash_logout</filename> file:</para>
309
310<screen><userinput><literal># Kill the D-BUS session daemon
311kill $DBUS_SESSION_BUS_PID</literal></userinput></screen>
312 </listitem>
313
314 <listitem>
315 <para>A hint has been written that provides ways to start scripts
316 using the KDM session manager of KDE. The concepts in this hint could
317 possibly be used with other session managers as well. The hint is
318 located at <ulink
319 url="&hints-root;/downloads/files/execute-session-scripts-using-kdm.txt"/>.
320 </para>
321 </listitem>
322
323 </itemizedlist>
324
325 </sect3>
326
327 </sect2>
328
329 <sect2 role="content">
330 <title>Contents</title>
331
332 <segmentedlist>
333 <segtitle>Installed Programs</segtitle>
334 <segtitle>Installed Library</segtitle>
335 <segtitle>Installed Directories</segtitle>
336
337 <seglistitem>
338 <seg>dbus-cleanup-sockets, dbus-daemon, dbus-daemon-launch-helper,
339 dbus-launch, dbus-monitor, dbus-send and dbus-uuidgen</seg>
340 <seg>libdbus-1.{so,a}</seg>
341 <seg>/etc/dbus-1/{session.d,system.d}, /usr/{include/dbus-1.0/dbus,
342 lib/{dbus-1.0/include/dbus,dbus/dbus-1},share/dbus-1/{services,
343 system-services}}, /var/{lib/dbus,run/dbus}</seg>
344 </seglistitem>
345 </segmentedlist>
346
347 <variablelist>
348 <bridgehead renderas="sect3">Short Descriptions</bridgehead>
349 <?dbfo list-presentation="list"?>
350 <?dbhtml list-presentation="table"?>
351
352 <varlistentry id="dbus-cleanup-sockets">
353 <term><command>dbus-cleanup-sockets</command></term>
354 <listitem>
355 <para>is used to clean up leftover sockets in a directory.</para>
356 <indexterm zone="dbus dbus-cleanup-sockets">
357 <primary sortas="b-dbus-cleanup-sockets">dbus-cleanup-sockets</primary>
358 </indexterm>
359 </listitem>
360 </varlistentry>
361
362 <varlistentry id="dbus-daemon">
363 <term><command>dbus-daemon</command></term>
364 <listitem>
365 <para>is the <application>D-BUS</application> message bus
366 daemon.</para>
367 <indexterm zone="dbus dbus-daemon">
368 <primary sortas="b-dbus-daemon">dbus-daemon</primary>
369 </indexterm>
370 </listitem>
371 </varlistentry>
372
373 <varlistentry id="dbus-launch">
374 <term><command>dbus-launch</command></term>
375 <listitem>
376 <para>is used to start <command>dbus-daemon</command> from a shell
377 script. It would normally be called from a user's login
378 scripts.</para>
379 <indexterm zone="dbus dbus-launch">
380 <primary sortas="b-dbus-launch">dbus-launch</primary>
381 </indexterm>
382 </listitem>
383 </varlistentry>
384
385 <varlistentry id="dbus-monitor">
386 <term><command>dbus-monitor</command></term>
387 <listitem>
388 <para>is used to monitor messages going through a
389 <application>D-BUS</application> message bus.</para>
390 <indexterm zone="dbus dbus-monitor">
391 <primary sortas="b-dbus-monitor">dbus-monitor</primary>
392 </indexterm>
393 </listitem>
394 </varlistentry>
395
396 <varlistentry id="dbus-send">
397 <term><command>dbus-send</command></term>
398 <listitem>
399 <para>is used to send a message to a <application>D-BUS</application>
400 message bus.</para>
401 <indexterm zone="dbus dbus-send">
402 <primary sortas="b-dbus-send">dbus-send</primary>
403 </indexterm>
404 </listitem>
405 </varlistentry>
406
407 <varlistentry id="dbus-uuidgen">
408 <term><command>dbus-uuidgen</command></term>
409 <listitem>
410 <para>is used to generate or read a universally unique ID.</para>
411 <indexterm zone="dbus dbus-uuidgen">
412 <primary sortas="b-dbus-uuidgen">dbus-uuidgen</primary>
413 </indexterm>
414 </listitem>
415 </varlistentry>
416
417 <varlistentry id="libdbus-1">
418 <term><filename class='libraryfile'>libdbus-1.{so,a}</filename></term>
419 <listitem>
420 <para>contains the API functions used by the
421 <application>D-BUS</application> message daemon.
422 <application>D-BUS</application> is first a library that provides
423 one-to-one communication between any two applications;
424 <command>dbus-daemon</command> is an application that uses this
425 library to implement a message bus daemon.</para>
426 <indexterm zone="dbus libdbus-1">
427 <primary sortas="c-libdbus-1">libdbus-1.{so,a}</primary>
428 </indexterm>
429 </listitem>
430 </varlistentry>
431
432 </variablelist>
433
434 </sect2>
435
436</sect1>
Note: See TracBrowser for help on using the repository browser.