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