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