source: general/sysutils/dbus.xml@ a659adf

systemd-13485
Last change on this file since a659adf was a659adf, checked in by DJ Lucas <dj@…>, 9 years ago

Complete previous intended change.

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

  • Property mode set to 100644
File size: 14.0 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-&lfs-dbus-version;.tar.gz">
8]>
9
10<sect1 id="dbus" xreflabel="D-Bus-&lfs-dbus-version;">
11 <?dbhtml filename="dbus.html"?>
12
13 <sect1info>
14 <othername>$LastChangedBy$</othername>
15 <date>$Date$</date>
16 </sect1info>
17
18 <title>D-Bus-&lfs-dbus-version;</title>
19
20 <indexterm zone="dbus">
21 <primary sortas="a-D-Bus">D-Bus</primary>
22 </indexterm>
23
24 <sect2 role="package">
25 <title>Introduction to D-Bus</title>
26
27 <para>
28 Even though <application>D-Bus</application> was built in
29 LFS, there are some features provided by the package that
30 some BLFS packages need, but their dependencies didn't fit
31 into LFS.
32 </para>
33<!--
34 <para>
35 Unlike other packages in BLFS, there is no set version of
36 <application>D-Bus</application> in this page's title and
37 no set version specified for download. Version updates to
38 <application>D-Bus</application> make it possible that the
39 user's system may have a <application>D-Bus</application>
40 version different from the one in the current LFS book.
41 Therefore, users should use the version of
42 <application>D-Bus</application> that is currently
43 installed on their system.
44 </para>
45-->
46 &lfs78_checked;
47
48 <bridgehead renderas="sect3">Package Information</bridgehead>
49 <itemizedlist spacing="compact">
50 <listitem>
51 <para>
52 Download (HTTP): <ulink url="&dbus-download-http;"/>
53 </para>
54 </listitem>
55 </itemizedlist>
56<!--
57 <note>
58 <para>
59 If you are unsure which version needs to be downloaded, issue
60 <command>dbus-daemon - -version</command> in order to find out.
61 Some of the commands below might need the version information.
62 Issue the following command to store the
63 <application>D-Bus</application> version number into an
64 environment variable:
65 </para>
66
67<screen><userinput>export DBUS_VERSION=$(dbus-daemon - -version | head -n1 | awk '{print $5}')</userinput></screen>
68 </note>
69-->
70 <bridgehead renderas="sect3">D-Bus Dependencies</bridgehead>
71
72 <bridgehead renderas="sect4">Required</bridgehead>
73 <para role="required">
74 <xref linkend="xorg7-lib"/> (for X11 autolaunch support)
75 </para>
76
77 <bridgehead renderas="sect4">Optional</bridgehead>
78 <para role="optional">
79 For the tests:
80 <xref linkend="dbus-glib"/>,
81 <xref linkend="dbus-python"/>,
82 <xref linkend="pygobject2"/> and
83 <xref linkend="valgrind"/>;
84
85 for documentation:
86 <xref linkend="doxygen"/>,
87 <xref linkend="xmlto"/>,
88 <ulink url="https://pypi.python.org/pypi/mallard-ducktype">Ducktype</ulink>,
89 and
90 <ulink url="http://ftp.gnome.org/pub/gnome/sources/yelp-tools/">Yelp Tools</ulink>
91 </para>
92
93 <para condition="html" role="usernotes">User Notes:
94 <ulink url="&blfs-wiki;/dbus"/>
95 </para>
96 </sect2>
97
98 <sect2 role="installation">
99 <title>Installation of D-Bus</title>
100
101 <para>
102 Rebuild <application>D-Bus</application> by running the
103 following commands:
104 </para>
105
106<screen><userinput>./configure --prefix=/usr \
107 --sysconfdir=/etc \
108 --localstatedir=/var \
109 --with-console-auth-dir=/run/console \
110 --docdir=/usr/share/doc/dbus-&lfs-dbus-version; &amp;&amp;
111make</userinput></screen>
112
113 <para>
114 See below for test instructions.
115 </para>
116
117 <warning>
118 <para>
119 Installing the package will override all files installed by
120 <application>D-Bus</application> in LFS. It is critical that
121 nothing uses <application>D-Bus</application> libraries or
122 programs during the installation phrase. Best way to achieve
123 that is to do the installation in the rescue mode. To switch
124 to the rescue mode, issue the following command as the
125 <systemitem class="username">root</systemitem> user from a TTY:
126 </para>
127
128<screen role="root"><userinput>systemctl start rescue.target</userinput></screen>
129 </warning>
130
131 <para>
132 Now, as the <systemitem class="username">root</systemitem> user:
133 </para>
134
135<screen role="root"><userinput>make install</userinput></screen>
136
137 <para>
138 The shared library needs to be moved to
139 <filename class="directory">/lib</filename>, and as a result the
140 <filename class="extension">.so</filename> file in
141 <filename class="directory">/usr/lib</filename> will need to be
142 recreated. Run the following command as the
143 <systemitem class="username">root</systemitem> user:
144 </para>
145
146<screen><userinput remap="install">mv -v /usr/lib/libdbus-1.so.* /lib
147ln -sfv ../../lib/$(readlink /usr/lib/libdbus-1.so) /usr/lib/libdbus-1.so</userinput></screen>
148
149 <para>
150 If you are using a DESTDIR install,
151 <command>dbus-daemon-launch-helper</command> needs to be fixed
152 afterwards. Issue, as <systemitem class="username">root</systemitem>
153 user:
154 </para>
155
156<screen role="root"><userinput>chown -v root:messagebus /usr/libexec/dbus-daemon-launch-helper &amp;&amp;
157chmod -v 4750 /usr/libexec/dbus-daemon-launch-helper</userinput></screen>
158
159 <para>
160 The <application>D-Bus</application> tests cannot be run until after
161 <xref linkend="dbus-glib"/> has been installed. They must be run as
162 an unprivileged user from a local session. If you want to run only
163 the unit tests, replace <parameter>--enable-tests</parameter> in the
164 command below with <parameter>--enable-embedded-tests</parameter>,
165 otherwise <xref linkend="dbus-python"/> has to be installed before
166 the tests are run. The tests require passing additional parameters to
167 <command>configure</command> and exposing additional functionality in
168 the binaries. These interfaces are not intended to be used in a
169 production build of <application>D-Bus</application>. If you would
170 like to run the tests, issue the following commands:
171 </para>
172
173<screen><userinput>make distclean &amp;&amp;
174./configure --enable-tests \
175 --enable-asserts \
176 --disable-doxygen-docs \
177 --disable-xml-docs \
178 --disable-static \
179 --with-console-auth-dir=/run/console/ \
180 --docdir=/usr/share/doc/dbus-&lfs-dbus-version; &amp;&amp;
181make &amp;&amp;
182make check</userinput></screen>
183
184 <para>
185 There has been a report that the tests may fail if running inside a
186 Midnight Commander shell. You may get out-of-memory error messages when
187 running the tests. These are normal and can be safely ignored.
188 </para>
189
190 </sect2>
191
192 <sect2 role="commands">
193 <title>Command Explanations</title>
194
195 <para>
196 <parameter>--disable-doxygen-docs</parameter>: This switch disables
197 doxygen documentation build and install, if you have
198 <application>doxygen</application> installed. Delete, if
199 <application>doxygen</application> is installed and you wish to build and
200 install them.
201 </para>
202
203 <para>
204 <parameter>--disable-xml-docs</parameter>: This switch disables html
205 documentation build and install, if you have
206 <application>xmlto</application> installed. Delete, if
207 <application>xmlto</application> is installed and you wish to build and
208 install them.
209 </para>
210
211 <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
212 href="../../xincludes/static-libraries.xml"/>
213
214 <para>
215 <parameter>--with-console-auth-dir=/run/console/</parameter>: This
216 parameter specifies location of the
217 <application>ConsoleKit</application> auth dir.
218 </para>
219
220 <para>
221 <parameter>--enable-tests</parameter>: Build extra parts of the code to
222 support all tests. Configure will end with a NOTE warning about increased
223 size of libraries and decreased security.
224 </para>
225
226 <para>
227 <parameter>--enable-embedded-tests</parameter>: Build extra parts of the
228 code to support only unit tests. Configure will end with a NOTE warning
229 about increased size of libraries and decreased security.
230 </para>
231
232 <para>
233 <parameter>--enable-asserts</parameter>: Enable debugging code to run
234 assertions for statements normally assumed to be true. This prevents a
235 warning that '<parameter>--enable-tests</parameter>' on its own is only
236 useful for profiling and might not give true results for all tests, but
237 adds its own NOTE that this should not be used in a production build.
238 </para>
239
240 </sect2>
241
242 <sect2 role="configuration">
243 <title>Configuring D-Bus</title>
244
245 <sect3 id="dbus-config">
246 <title>Config Files</title>
247
248 <para>
249 <filename>/etc/dbus-1/session.conf</filename>,
250 <filename>/etc/dbus-1/system.conf</filename> and
251 <filename>/etc/dbus-1/system.d/*</filename>
252 </para>
253
254 <indexterm zone="dbus dbus-config">
255 <primary sortas="e-etc-dbus-1-session.conf">/etc/dbus-1/session.conf</primary>
256 </indexterm>
257
258 <indexterm zone="dbus dbus-config">
259 <primary sortas="e-etc-dbus-1/system.conf">/etc/dbus-1/system.conf</primary>
260 </indexterm>
261
262 <indexterm zone="dbus dbus-config">
263 <primary sortas="e-etc-dbus-1-system.d-star">/etc/dbus-1/system.d/*</primary>
264 </indexterm>
265
266 </sect3>
267
268 <sect3 id="dbus-session-config" xreflabel="D-Bus custom services directory">
269 <title>Configuration Information</title>
270
271 <para>
272 The configuration files listed above should probably not be
273 modified. If changes are required, you should create
274 <filename>/etc/dbus-1/session-local.conf</filename> and/or
275 <filename>/etc/dbus-1/system-local.conf</filename> and make any
276 desired changes to these files.
277 </para>
278
279 <para>
280 If any packages install a
281 <application>D-Bus</application> <filename>.service</filename>
282 file outside of the standard <filename
283 class="directory">/usr/share/dbus-1/services</filename> directory,
284 that directory should be added to the local session configuration.
285 For instance, <filename
286 class="directory">/usr/local/share/dbus-1/services</filename> can
287 be added by performing the following commands as the
288 <systemitem class="username">root</systemitem> user:
289 </para>
290
291<screen role="root"><userinput>cat &gt; /etc/dbus-1/session-local.conf &lt;&lt; "EOF"
292<literal>&lt;!DOCTYPE busconfig PUBLIC
293 "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
294 "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd"&gt;
295&lt;busconfig&gt;
296
297 &lt;!-- Search for .service files in /usr/local --&gt;
298 &lt;servicedir&gt;/usr/local/share/dbus-1/services&lt;/servicedir&gt;
299
300&lt;/busconfig&gt;</literal>
301EOF</userinput></screen>
302
303 </sect3>
304
305 <sect3 id="dbus-session">
306 <title>D-Bus Session Daemon</title>
307
308 <para>
309 There are many methods you can use to start a session daemon
310 using the <command>dbus-launch</command> command. Review the
311 <command>dbus-launch</command> man page for details about the
312 available parameters and options. Here are some suggestions and
313 examples:
314 </para>
315
316 <itemizedlist spacing="compact">
317 <listitem>
318 <para>
319 Add <command>dbus-launch</command> to the line in the
320 <filename>~/.xinitrc</filename> file that starts your graphical
321 desktop environment.
322 </para>
323 </listitem>
324 <listitem>
325 <para>
326 If you use <command>xdm</command> or some other display manager
327 that calls the <filename>~/.xsession</filename> file, you can add
328 <command>dbus-launch</command> to the line in your
329 <filename>~/.xsession</filename> file that starts your graphical
330 desktop environment. The syntax would be similar to the example in
331 the <filename>~/.xinitrc</filename> file.
332 </para>
333 </listitem>
334 <listitem>
335 <para>
336 The examples shown previously use
337 <command>dbus-launch</command> to specify a program to be run. This
338 has the benefit (when also using the
339 <parameter>--exit-with-session</parameter> parameter) of stopping the
340 session daemon when the specified program is stopped. You can also
341 start the session daemon in your system or personal startup scripts
342 by adding the following lines:
343 </para>
344
345<screen><userinput><literal># Start the D-Bus session daemon
346eval `dbus-launch`
347export DBUS_SESSION_BUS_ADDRESS</literal></userinput></screen>
348
349 <para>
350 This method will not stop the session daemon when you exit
351 your shell, therefore you should add the following line to your
352 <filename>~/.bash_logout</filename> file:
353 </para>
354
355<screen><userinput><literal># Kill the D-Bus session daemon
356kill $DBUS_SESSION_BUS_PID</literal></userinput></screen>
357 </listitem>
358
359 <listitem>
360 <para>
361 A hint has been written that provides ways to start scripts
362 using the KDM session manager of KDE. The concepts in this hint could
363 possibly be used with other session managers as well. The hint is
364 located at <ulink
365 url="&hints-root;/downloads/files/execute-session-scripts-using-kdm.txt"/>.
366 </para>
367 </listitem>
368
369 </itemizedlist>
370
371 </sect3>
372
373 </sect2>
374
375 <sect2 role="content">
376 <title>Contents</title>
377
378 <para>
379 A list of the installed files, along with their short
380 descriptions can be found at
381 <ulink url="&lfs-root;/chapter06/dbus.html#contents-dbus"/>.
382 </para>
383
384 </sect2>
385
386</sect1>
387
Note: See TracBrowser for help on using the repository browser.