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