[e8e3312d] | 1 | <?xml version="1.0" encoding="ISO-8859-1"?>
|
---|
[6732c094] | 2 | <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
|
---|
| 3 | "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
|
---|
[e8e3312d] | 4 | <!ENTITY % general-entities SYSTEM "../../general.ent">
|
---|
| 5 | %general-entities;
|
---|
| 6 |
|
---|
[8dfc5c3] | 7 | <!ENTITY dbus-download-http "https://dbus.freedesktop.org/releases/dbus/dbus-&dbus-version;.tar.gz">
|
---|
[30d0aef] | 8 | <!ENTITY dbus-download-ftp " ">
|
---|
[819a4c7] | 9 | <!ENTITY dbus-md5sum "2dbeae80dfc9e3632320c6a53d5e8890">
|
---|
[66d9ef8] | 10 | <!ENTITY dbus-size "2.0 MB">
|
---|
[819a4c7] | 11 | <!ENTITY dbus-buildsize "21 MB (add 17 MB for the tests)">
|
---|
| 12 | <!ENTITY dbus-time "0.3 SBU (add 8.5 SBU for the tests)">
|
---|
| 13 | <!-- The former value was 0.8 SBU, which was far more sensible. -->
|
---|
[e8e3312d] | 14 | ]>
|
---|
| 15 |
|
---|
[fdaae04] | 16 | <sect1 id="dbus" xreflabel="dbus-&dbus-version;">
|
---|
[e8e3312d] | 17 | <?dbhtml filename="dbus.html"?>
|
---|
| 18 |
|
---|
| 19 | <sect1info>
|
---|
| 20 | <othername>$LastChangedBy$</othername>
|
---|
| 21 | <date>$Date$</date>
|
---|
| 22 | </sect1info>
|
---|
| 23 |
|
---|
[53375fc] | 24 | <title>dbus-&dbus-version;</title>
|
---|
[e8e3312d] | 25 |
|
---|
[54666831] | 26 | <indexterm zone="dbus">
|
---|
| 27 | <primary sortas="a-D-Bus">D-Bus</primary>
|
---|
[e8e3312d] | 28 | </indexterm>
|
---|
| 29 |
|
---|
| 30 | <sect2 role="package">
|
---|
[54666831] | 31 | <title>Introduction to D-Bus</title>
|
---|
[e8e3312d] | 32 |
|
---|
[5c9e998] | 33 | <para revision="sysv">
|
---|
[108beaf] | 34 | <application>D-Bus</application> is a message bus system, a simple way
|
---|
| 35 | for applications to talk to one another.
|
---|
| 36 | <application>D-Bus</application> supplies both a system daemon (for
|
---|
| 37 | events such as <quote>new hardware device added</quote> or <quote>printer
|
---|
| 38 | queue changed</quote>) and a per-user-login-session daemon (for general
|
---|
| 39 | IPC needs among user applications). Also, the message bus is built on top
|
---|
| 40 | of a general one-to-one message passing framework, which can be used by
|
---|
| 41 | any two applications to communicate directly (without going through the
|
---|
| 42 | message bus daemon).
|
---|
[0b83a69] | 43 | </para>
|
---|
[e8e3312d] | 44 |
|
---|
[5c9e998] | 45 | <para revision="systemd">
|
---|
| 46 | Even though <application>D-Bus</application> was built in LFS, there are
|
---|
| 47 | some features provided by the package that other BLFS packages need, but
|
---|
| 48 | their dependencies didn't fit into LFS.
|
---|
| 49 | </para>
|
---|
| 50 |
|
---|
[82bdecf] | 51 | &lfs90_checked;
|
---|
[482477c] | 52 |
|
---|
[e8e3312d] | 53 | <bridgehead renderas="sect3">Package Information</bridgehead>
|
---|
| 54 | <itemizedlist spacing="compact">
|
---|
| 55 | <listitem>
|
---|
[0b83a69] | 56 | <para>
|
---|
| 57 | Download (HTTP): <ulink url="&dbus-download-http;"/>
|
---|
| 58 | </para>
|
---|
[e8e3312d] | 59 | </listitem>
|
---|
| 60 | <listitem>
|
---|
[0b83a69] | 61 | <para>
|
---|
| 62 | Download (FTP): <ulink url="&dbus-download-ftp;"/>
|
---|
| 63 | </para>
|
---|
[e8e3312d] | 64 | </listitem>
|
---|
| 65 | <listitem>
|
---|
[0b83a69] | 66 | <para>
|
---|
| 67 | Download MD5 sum: &dbus-md5sum;
|
---|
| 68 | </para>
|
---|
[e8e3312d] | 69 | </listitem>
|
---|
| 70 | <listitem>
|
---|
[0b83a69] | 71 | <para>
|
---|
| 72 | Download size: &dbus-size;
|
---|
| 73 | </para>
|
---|
[e8e3312d] | 74 | </listitem>
|
---|
| 75 | <listitem>
|
---|
[0b83a69] | 76 | <para>
|
---|
| 77 | Estimated disk space required: &dbus-buildsize;
|
---|
| 78 | </para>
|
---|
[e8e3312d] | 79 | </listitem>
|
---|
| 80 | <listitem>
|
---|
[0b83a69] | 81 | <para>
|
---|
| 82 | Estimated build time: &dbus-time;
|
---|
| 83 | </para>
|
---|
[e8e3312d] | 84 | </listitem>
|
---|
| 85 | </itemizedlist>
|
---|
| 86 |
|
---|
[02e742b] | 87 | <bridgehead renderas="sect3">D-Bus Dependencies</bridgehead>
|
---|
[e8e3312d] | 88 |
|
---|
[f29eb8a] | 89 | <bridgehead renderas="sect4" revision="systemd">Required</bridgehead>
|
---|
| 90 | <para role="required" revision="systemd">
|
---|
| 91 | <xref linkend="systemd"/>
|
---|
| 92 | </para>
|
---|
| 93 |
|
---|
[51dfb3e] | 94 |
|
---|
[54666831] | 95 | <bridgehead renderas="sect4">Recommended</bridgehead>
|
---|
| 96 | <para role="recommended">
|
---|
[bc3bb455] | 97 | <xref linkend="xorg7-lib"/> (for <command>dbus-launch</command> program)
|
---|
| 98 | <phrase revision="sysv">and <xref linkend="elogind"/> (These are
|
---|
| 99 | circular dependencies. First build without them, and then again after
|
---|
| 100 | both packages are installed.)</phrase>
|
---|
[0b83a69] | 101 | </para>
|
---|
[adfdc8b] | 102 |
|
---|
[e8e3312d] | 103 | <bridgehead renderas="sect4">Optional</bridgehead>
|
---|
[b6a2a0e] | 104 | <para role="optional">
|
---|
[f1d25d2] | 105 | For the tests:
|
---|
[cafc6c84] | 106 | <xref linkend="dbus-glib"/>,
|
---|
[c358685] | 107 | <xref linkend="dbus-python"/>,
|
---|
[1665413] | 108 | <xref linkend="pygobject3"/>,
|
---|
[48b0ed4] | 109 | and <xref linkend="valgrind"/>;
|
---|
[c358685] | 110 |
|
---|
| 111 | for documentation:
|
---|
| 112 | <xref linkend="doxygen"/>,
|
---|
| 113 | <xref linkend="xmlto"/>,
|
---|
| 114 | <ulink url="https://pypi.python.org/pypi/mallard-ducktype">Ducktype</ulink>,
|
---|
| 115 | and
|
---|
| 116 | <ulink url="http://ftp.gnome.org/pub/gnome/sources/yelp-tools/">Yelp Tools</ulink>
|
---|
[0b83a69] | 117 | </para>
|
---|
[c45cb57] | 118 |
|
---|
[1039de3] | 119 | <para condition="html" role="usernotes">User Notes:
|
---|
[0b83a69] | 120 | <ulink url="&blfs-wiki;/dbus"/>
|
---|
| 121 | </para>
|
---|
[e8e3312d] | 122 | </sect2>
|
---|
| 123 |
|
---|
| 124 | <sect2 role="installation">
|
---|
[02e742b] | 125 | <title>Installation of D-Bus</title>
|
---|
[2543b8af] | 126 | <!--
|
---|
[670d3f8] | 127 | <para revision="sysv">
|
---|
[ef52ec2] | 128 | If they do not already exist,
|
---|
| 129 | as the <systemitem class="username">root</systemitem> user, create a
|
---|
[54666831] | 130 | system user and group to handle the system message bus activity:
|
---|
| 131 | </para>
|
---|
| 132 |
|
---|
[670d3f8] | 133 | <screen role="root" revision="sysv"><userinput>groupadd -g 18 messagebus &&
|
---|
[54666831] | 134 | useradd -c "D-Bus Message Daemon User" -d /var/run/dbus \
|
---|
| 135 | -u 18 -g messagebus -s /bin/false messagebus</userinput></screen>
|
---|
[2543b8af] | 136 | -->
|
---|
[54666831] | 137 |
|
---|
| 138 | <para>
|
---|
| 139 | Install <application>D-Bus</application> by running the following
|
---|
[108beaf] | 140 | commands (you may wish to review the output from <command>./configure
|
---|
| 141 | --help</command> first and add any desired parameters to the
|
---|
| 142 | <command>configure</command> command shown below):
|
---|
[0b83a69] | 143 | </para>
|
---|
[e8e3312d] | 144 |
|
---|
[9eb7ee7] | 145 | <screen revision="sysv"><userinput>./configure --prefix=/usr \
|
---|
[f29eb8a] | 146 | --sysconfdir=/etc \
|
---|
| 147 | --localstatedir=/var \
|
---|
[51dfb3e] | 148 | --enable-user-session \
|
---|
[f29eb8a] | 149 | --disable-doxygen-docs \
|
---|
| 150 | --disable-xml-docs \
|
---|
| 151 | --disable-static \
|
---|
[51dfb3e] | 152 | --with-systemduserunitdir=no \
|
---|
| 153 | --with-systemdsystemunitdir=no \
|
---|
[f29eb8a] | 154 | --docdir=/usr/share/doc/dbus-&dbus-version; \
|
---|
[fda8d05f] | 155 | --with-console-auth-dir=/run/console \
|
---|
[f29eb8a] | 156 | --with-system-pid-file=/run/dbus/pid \
|
---|
| 157 | --with-system-socket=/run/dbus/system_bus_socket &&
|
---|
[e8e3312d] | 158 | make</userinput></screen>
|
---|
| 159 |
|
---|
[f29eb8a] | 160 | <screen revision="systemd"><userinput>./configure --prefix=/usr \
|
---|
| 161 | --sysconfdir=/etc \
|
---|
| 162 | --localstatedir=/var \
|
---|
| 163 | --enable-user-session \
|
---|
| 164 | --disable-doxygen-docs \
|
---|
| 165 | --disable-xml-docs \
|
---|
| 166 | --disable-static \
|
---|
| 167 | --docdir=/usr/share/doc/dbus-&dbus-version; \
|
---|
[fda8d05f] | 168 | --with-console-auth-dir=/run/console \
|
---|
[f29eb8a] | 169 | --with-system-pid-file=/run/dbus/pid \
|
---|
| 170 | --with-system-socket=/run/dbus/system_bus_socket &&
|
---|
[5c9e998] | 171 | make</userinput></screen>
|
---|
| 172 |
|
---|
[0b83a69] | 173 | <para>
|
---|
| 174 | See below for test instructions.
|
---|
| 175 | </para>
|
---|
[c45cb57] | 176 |
|
---|
[5c9e998] | 177 | <warning revision="systemd">
|
---|
| 178 | <para>
|
---|
| 179 | Installing the package will override all files installed by
|
---|
| 180 | <application>D-Bus</application> in LFS. It is critical that
|
---|
| 181 | nothing uses <application>D-Bus</application> libraries or
|
---|
[670d3f8] | 182 | programs during the installation. The best way to ensure that these
|
---|
| 183 | libraries are not being used is to run the installation in rescue mode.
|
---|
| 184 | To switch to rescue mode, run the following command as the
|
---|
| 185 | <systemitem class="username">root</systemitem> user (from a TTY):
|
---|
[5c9e998] | 186 | </para>
|
---|
[670d3f8] | 187 |
|
---|
| 188 | <screen role="root"><userinput>systemctl start rescue.target</userinput></screen>
|
---|
| 189 |
|
---|
[5c9e998] | 190 | </warning>
|
---|
| 191 |
|
---|
[0b83a69] | 192 | <para>
|
---|
| 193 | Now, as the <systemitem class="username">root</systemitem> user:
|
---|
| 194 | </para>
|
---|
[e8e3312d] | 195 |
|
---|
[108beaf] | 196 | <screen role="root"><userinput>make install</userinput></screen>
|
---|
[b6a2a0e] | 197 |
|
---|
[51dfb3e] | 198 | <para>
|
---|
[787a2e75] | 199 | The shared library needs to be moved to
|
---|
| 200 | <filename class="directory">/lib</filename>, and as a result the
|
---|
| 201 | <filename class="extension">.so</filename> file in
|
---|
| 202 | <filename class="directory">/usr/lib</filename> will need to be
|
---|
| 203 | recreated. Run the following command as the
|
---|
| 204 | <systemitem class="username">root</systemitem> user:
|
---|
| 205 | </para>
|
---|
| 206 |
|
---|
[51dfb3e] | 207 | <screen role="root"><userinput>mv -v /usr/lib/libdbus-1.so.* /lib &&
|
---|
[787a2e75] | 208 | ln -sfv ../../lib/$(readlink /usr/lib/libdbus-1.so) /usr/lib/libdbus-1.so</userinput></screen>
|
---|
| 209 |
|
---|
[bf8eb65] | 210 | <para>
|
---|
| 211 | If you are using a DESTDIR install,
|
---|
| 212 | <command>dbus-daemon-launch-helper</command> needs to be fixed
|
---|
| 213 | afterwards. Issue, as <systemitem class="username">root</systemitem>
|
---|
| 214 | user:
|
---|
| 215 | </para>
|
---|
| 216 |
|
---|
| 217 | <screen role="root"><userinput>chown -v root:messagebus /usr/libexec/dbus-daemon-launch-helper &&
|
---|
| 218 | chmod -v 4750 /usr/libexec/dbus-daemon-launch-helper</userinput></screen>
|
---|
| 219 |
|
---|
[787a2e75] | 220 | <para revision="sysv">
|
---|
[54666831] | 221 | If you are still building your system in chroot or you did not start the
|
---|
| 222 | daemon yet, but you want to compile some packages that require
|
---|
[819a4c7] | 223 | <application>D-Bus</application>, generate the
|
---|
[54666831] | 224 | <application>D-Bus</application> UUID to avoid warnings when compiling
|
---|
| 225 | some packages with the following command as the
|
---|
[3bbf74c5] | 226 | <systemitem class="username">root</systemitem> user:
|
---|
| 227 | </para>
|
---|
| 228 |
|
---|
[787a2e75] | 229 | <screen role="root" revision="sysv"><userinput>dbus-uuidgen --ensure</userinput></screen>
|
---|
[54666831] | 230 |
|
---|
[51dfb3e] | 231 | <para revision="sysv">
|
---|
| 232 | If using <xref linkend="elogind"/>, create a symlink to the
|
---|
| 233 | <filename>/var/lib/dbus/machine-id</filename> file:
|
---|
| 234 | </para>
|
---|
| 235 |
|
---|
| 236 | <screen role="root" revision="sysv"><userinput>ln -sv /var/lib/dbus/machine-id /etc</userinput></screen>
|
---|
| 237 |
|
---|
[5c9e998] | 238 | <para revision="systemd">
|
---|
| 239 | If not in chroot, at this point, you should reload the systemd daemon,
|
---|
| 240 | and reenter multi-user mode with the following commands (as the
|
---|
| 241 | <systemitem class="username">root</systemitem> user):
|
---|
| 242 | </para>
|
---|
| 243 |
|
---|
| 244 | <screen role="root" revision="systemd"><userinput>systemctl daemon-reload
|
---|
| 245 | systemctl start multi-user.target</userinput></screen>
|
---|
| 246 |
|
---|
[3bbf74c5] | 247 | <para>
|
---|
[108beaf] | 248 | The dbus tests cannot be run until after <xref linkend="dbus-glib"/> has
|
---|
| 249 | been installed. They must be run as an unprivileged user from a local
|
---|
[1665413] | 250 | session with bus address. To run the standard tests issue
|
---|
| 251 | <command>make check</command>.
|
---|
| 252 | </para>
|
---|
| 253 |
|
---|
| 254 | <para>
|
---|
| 255 | If you want to run the unit regression tests, configure requires
|
---|
| 256 | additional parameters which expose additional functionality in the
|
---|
| 257 | binaries that are not intended to be used in a production build of
|
---|
[108beaf] | 258 | <application>D-Bus</application>. If you would like to run the tests,
|
---|
[6092d19] | 259 | issue the following commands (for the tests, you don't need to build the
|
---|
| 260 | docs):
|
---|
[0b83a69] | 261 | </para>
|
---|
[0d7900a] | 262 |
|
---|
[2f3e3de9] | 263 | <screen remap="test"><userinput>make distclean &&
|
---|
[6092d19] | 264 | ./configure --enable-tests \
|
---|
| 265 | --enable-asserts \
|
---|
| 266 | --disable-doxygen-docs \
|
---|
| 267 | --disable-xml-docs &&
|
---|
| 268 | make &&
|
---|
[02fc2ae] | 269 | make check</userinput></screen>
|
---|
[c45cb57] | 270 |
|
---|
[53dd18f1] | 271 | <para>
|
---|
[1665413] | 272 | The test <command>test-bus.sh</command> is known to fail. There has also
|
---|
| 273 | been reports that the tests may fail if running inside a Midnight
|
---|
| 274 | Commander shell. You may get out-of-memory error messages when running
|
---|
| 275 | the tests. These are normal and can be safely ignored.
|
---|
[54666831] | 276 | </para>
|
---|
[e8e3312d] | 277 |
|
---|
| 278 | </sect2>
|
---|
| 279 |
|
---|
| 280 | <sect2 role="commands">
|
---|
| 281 | <title>Command Explanations</title>
|
---|
| 282 |
|
---|
[108beaf] | 283 | <para>
|
---|
| 284 | <parameter>--disable-doxygen-docs</parameter>: This switch disables
|
---|
[6092d19] | 285 | doxygen documentation build and install, if you have
|
---|
[670d3f8] | 286 | <application>doxygen</application> installed. If
|
---|
| 287 | <application>doxygen</application> is installed, and you wish to build
|
---|
| 288 | them, remove this parameter.
|
---|
[108beaf] | 289 | </para>
|
---|
| 290 |
|
---|
[6092d19] | 291 | <para>
|
---|
| 292 | <parameter>--disable-xml-docs</parameter>: This switch disables html
|
---|
| 293 | documentation build and install, if you have
|
---|
[670d3f8] | 294 | <application>xmlto</application> installed. If
|
---|
| 295 | <application>xmlto</application> is installed, and you wish to build
|
---|
| 296 | them, remove this parameter.
|
---|
[6092d19] | 297 | </para>
|
---|
| 298 |
|
---|
[4532b2f] | 299 | <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
|
---|
| 300 | href="../../xincludes/static-libraries.xml"/>
|
---|
| 301 |
|
---|
[51dfb3e] | 302 | <para>
|
---|
| 303 | <parameter>--enable-user-session</parameter>: This parameter enables
|
---|
| 304 | per-user DBus sessions with
|
---|
| 305 | <phrase revision="sysv"><application>elogind</application>.</phrase>
|
---|
| 306 | <phrase revision="systemd"><application>systemd</application>.</phrase>
|
---|
[54666831] | 307 | </para>
|
---|
| 308 |
|
---|
[5c9e998] | 309 | <para revision="sysv">
|
---|
[51dfb3e] | 310 | <parameter>--with-systemd{user,system}unitdir=</parameter>: These
|
---|
| 311 | switches disable installation of systemd units on elogind based systems.
|
---|
[f29eb8a] | 312 | </para>
|
---|
[4532b2f] | 313 | <para>
|
---|
| 314 | <parameter>--with-console-auth-dir=/run/console/</parameter>: This
|
---|
[d43c7a12] | 315 | parameter specifies the directory to check for console ownerhip.
|
---|
[4532b2f] | 316 | </para>
|
---|
[0b83a69] | 317 |
|
---|
[f29eb8a] | 318 | <para>
|
---|
| 319 | <parameter>--with-system-pid-file=/run/dbus/pid</parameter>: This
|
---|
| 320 | parameter specifies the location of the PID file.
|
---|
| 321 | </para>
|
---|
| 322 |
|
---|
| 323 | <para>
|
---|
| 324 | <parameter>--with-system-socket=/run/dbus/system_bus_socket</parameter>:
|
---|
| 325 | This parameter specifies the location of the system bus socket.
|
---|
| 326 | </para>
|
---|
| 327 |
|
---|
[0b83a69] | 328 | <para>
|
---|
[e5347c36] | 329 | <parameter>--enable-tests</parameter>: Build extra parts of the code to
|
---|
[1665413] | 330 | support all tests. Do not use on a production build.
|
---|
[4947a7a] | 331 | </para>
|
---|
| 332 |
|
---|
| 333 | <para>
|
---|
[881cfa0] | 334 | <option>--enable-embedded-tests</option>: Build extra parts of the
|
---|
[1665413] | 335 | code to support only unit tests. Do not use on a production build.
|
---|
[0b83a69] | 336 | </para>
|
---|
| 337 |
|
---|
| 338 | <para>
|
---|
[e5347c36] | 339 | <parameter>--enable-asserts</parameter>: Enable debugging code to run
|
---|
| 340 | assertions for statements normally assumed to be true. This prevents a
|
---|
| 341 | warning that '<parameter>--enable-tests</parameter>' on its own is only
|
---|
| 342 | useful for profiling and might not give true results for all tests, but
|
---|
| 343 | adds its own NOTE that this should not be used in a production build.
|
---|
[0b83a69] | 344 | </para>
|
---|
[30d0aef] | 345 |
|
---|
[e8e3312d] | 346 | </sect2>
|
---|
| 347 |
|
---|
| 348 | <sect2 role="configuration">
|
---|
[670d3f8] | 349 | <title>Configuring D-Bus</title>
|
---|
[e8e3312d] | 350 |
|
---|
| 351 | <sect3 id="dbus-config">
|
---|
| 352 | <title>Config Files</title>
|
---|
[0b83a69] | 353 |
|
---|
| 354 | <para>
|
---|
| 355 | <filename>/etc/dbus-1/session.conf</filename>,
|
---|
| 356 | <filename>/etc/dbus-1/system.conf</filename> and
|
---|
| 357 | <filename>/etc/dbus-1/system.d/*</filename>
|
---|
| 358 | </para>
|
---|
[e8e3312d] | 359 |
|
---|
[54666831] | 360 | <indexterm zone="dbus dbus-config">
|
---|
[e8e3312d] | 361 | <primary sortas="e-etc-dbus-1-session.conf">/etc/dbus-1/session.conf</primary>
|
---|
| 362 | </indexterm>
|
---|
| 363 |
|
---|
[54666831] | 364 | <indexterm zone="dbus dbus-config">
|
---|
[e8e3312d] | 365 | <primary sortas="e-etc-dbus-1/system.conf">/etc/dbus-1/system.conf</primary>
|
---|
| 366 | </indexterm>
|
---|
| 367 |
|
---|
[54666831] | 368 | <indexterm zone="dbus dbus-config">
|
---|
[c45cb57] | 369 | <primary sortas="e-etc-dbus-1-system.d-star">/etc/dbus-1/system.d/*</primary>
|
---|
[e8e3312d] | 370 | </indexterm>
|
---|
| 371 |
|
---|
| 372 | </sect3>
|
---|
| 373 |
|
---|
[e9efab0b] | 374 | <sect3 id="dbus-session-config" xreflabel="D-Bus custom services directory">
|
---|
| 375 | <title>Configuration Information</title>
|
---|
[e8e3312d] | 376 |
|
---|
[0b83a69] | 377 | <para>
|
---|
| 378 | The configuration files listed above should probably not be
|
---|
| 379 | modified. If changes are required, you should create
|
---|
| 380 | <filename>/etc/dbus-1/session-local.conf</filename> and/or
|
---|
| 381 | <filename>/etc/dbus-1/system-local.conf</filename> and make any
|
---|
| 382 | desired changes to these files.
|
---|
| 383 | </para>
|
---|
| 384 |
|
---|
| 385 | <para>
|
---|
| 386 | If any packages install a
|
---|
| 387 | <application>D-Bus</application> <filename>.service</filename>
|
---|
| 388 | file outside of the standard <filename
|
---|
| 389 | class="directory">/usr/share/dbus-1/services</filename> directory,
|
---|
| 390 | that directory should be added to the local session configuration.
|
---|
| 391 | For instance, <filename
|
---|
| 392 | class="directory">/usr/local/share/dbus-1/services</filename> can
|
---|
| 393 | be added by performing the following commands as the
|
---|
| 394 | <systemitem class="username">root</systemitem> user:
|
---|
| 395 | </para>
|
---|
[57aa7a28] | 396 |
|
---|
| 397 | <screen role="root"><userinput>cat > /etc/dbus-1/session-local.conf << "EOF"
|
---|
| 398 | <literal><!DOCTYPE busconfig PUBLIC
|
---|
| 399 | "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
|
---|
| 400 | "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
|
---|
| 401 | <busconfig>
|
---|
| 402 |
|
---|
| 403 | <!-- Search for .service files in /usr/local -->
|
---|
| 404 | <servicedir>/usr/local/share/dbus-1/services</servicedir>
|
---|
| 405 |
|
---|
| 406 | </busconfig></literal>
|
---|
| 407 | EOF</userinput></screen>
|
---|
| 408 |
|
---|
[e8e3312d] | 409 | </sect3>
|
---|
| 410 |
|
---|
[670d3f8] | 411 | <sect3 id="dbus-session">
|
---|
[5c9e998] | 412 | <title>D-Bus Session Daemon</title>
|
---|
[e8e3312d] | 413 |
|
---|
[5c9e998] | 414 | <para revision="sysv">
|
---|
[54666831] | 415 | To automatically start <command>dbus-daemon</command> when the
|
---|
| 416 | system is rebooted, install the
|
---|
| 417 | <filename>/etc/rc.d/init.d/dbus</filename> bootscript from the
|
---|
| 418 | <xref linkend="bootscripts"/> package.
|
---|
| 419 | </para>
|
---|
| 420 |
|
---|
[670d3f8] | 421 | <indexterm zone="dbus dbus-session" revision="sysv">
|
---|
[54666831] | 422 | <primary sortas="f-dbus">dbus</primary>
|
---|
| 423 | </indexterm>
|
---|
| 424 |
|
---|
[5c9e998] | 425 | <screen role="root" revision="sysv"><userinput>make install-dbus</userinput></screen>
|
---|
[54666831] | 426 |
|
---|
[5c9e998] | 427 | <para revision="sysv">
|
---|
[54666831] | 428 | Note that this boot script only starts the system-wide
|
---|
| 429 | <application>D-Bus</application> daemon. Each user requiring access to
|
---|
| 430 | <application>D-Bus</application> services will also need to run a
|
---|
| 431 | session daemon as well. There are many methods you can use to start a
|
---|
[0b83a69] | 432 | session daemon using the <command>dbus-launch</command> command. Review
|
---|
| 433 | the <command>dbus-launch</command> man page for details about the
|
---|
| 434 | available parameters and options. Here are some suggestions and
|
---|
| 435 | examples:
|
---|
| 436 | </para>
|
---|
[3565e02] | 437 |
|
---|
[5c9e998] | 438 | <para revision="systemd">
|
---|
| 439 | There are many methods you can use to start a session daemon
|
---|
| 440 | using the <command>dbus-launch</command> command. Review the
|
---|
| 441 | <command>dbus-launch</command> man page for details about the
|
---|
| 442 | available parameters and options. Here are some suggestions and
|
---|
| 443 | examples:
|
---|
| 444 | </para>
|
---|
| 445 |
|
---|
| 446 |
|
---|
[3565e02] | 447 | <itemizedlist spacing="compact">
|
---|
| 448 | <listitem>
|
---|
[0b83a69] | 449 | <para>
|
---|
| 450 | Add <command>dbus-launch</command> to the line in the
|
---|
| 451 | <filename>~/.xinitrc</filename> file that starts your graphical
|
---|
| 452 | desktop environment.
|
---|
| 453 | </para>
|
---|
[3565e02] | 454 | </listitem>
|
---|
| 455 | <listitem>
|
---|
[0b83a69] | 456 | <para>
|
---|
| 457 | If you use <command>xdm</command> or some other display manager
|
---|
| 458 | that calls the <filename>~/.xsession</filename> file, you can add
|
---|
| 459 | <command>dbus-launch</command> to the line in your
|
---|
| 460 | <filename>~/.xsession</filename> file that starts your graphical
|
---|
| 461 | desktop environment. The syntax would be similar to the example in
|
---|
| 462 | the <filename>~/.xinitrc</filename> file.
|
---|
| 463 | </para>
|
---|
[3565e02] | 464 | </listitem>
|
---|
| 465 | <listitem>
|
---|
[0b83a69] | 466 | <para>
|
---|
| 467 | The examples shown previously use
|
---|
| 468 | <command>dbus-launch</command> to specify a program to be run. This
|
---|
| 469 | has the benefit (when also using the
|
---|
| 470 | <parameter>--exit-with-session</parameter> parameter) of stopping the
|
---|
| 471 | session daemon when the specified program is stopped. You can also
|
---|
| 472 | start the session daemon in your system or personal startup scripts
|
---|
| 473 | by adding the following lines:
|
---|
| 474 | </para>
|
---|
[3565e02] | 475 |
|
---|
[dac5077] | 476 | <screen role="nodump"><userinput><literal># Start the D-Bus session daemon
|
---|
[3565e02] | 477 | eval `dbus-launch`
|
---|
| 478 | export DBUS_SESSION_BUS_ADDRESS</literal></userinput></screen>
|
---|
| 479 |
|
---|
[0b83a69] | 480 | <para>
|
---|
| 481 | This method will not stop the session daemon when you exit
|
---|
| 482 | your shell, therefore you should add the following line to your
|
---|
| 483 | <filename>~/.bash_logout</filename> file:
|
---|
| 484 | </para>
|
---|
[3565e02] | 485 |
|
---|
[dac5077] | 486 | <screen role="nodump"><userinput><literal># Kill the D-Bus session daemon
|
---|
[3565e02] | 487 | kill $DBUS_SESSION_BUS_PID</literal></userinput></screen>
|
---|
[bccbdaea] | 488 | </listitem>
|
---|
[4ec808b] | 489 |
|
---|
[3565e02] | 490 | <listitem>
|
---|
[0b83a69] | 491 | <para>
|
---|
| 492 | A hint has been written that provides ways to start scripts
|
---|
| 493 | using the KDM session manager of KDE. The concepts in this hint could
|
---|
| 494 | possibly be used with other session managers as well. The hint is
|
---|
| 495 | located at <ulink
|
---|
| 496 | url="&hints-root;/downloads/files/execute-session-scripts-using-kdm.txt"/>.
|
---|
[c45cb57] | 497 | </para>
|
---|
[3565e02] | 498 | </listitem>
|
---|
[c45cb57] | 499 |
|
---|
[3565e02] | 500 | </itemizedlist>
|
---|
| 501 |
|
---|
[e8e3312d] | 502 | </sect3>
|
---|
| 503 |
|
---|
| 504 | </sect2>
|
---|
| 505 |
|
---|
[5c9e998] | 506 | <sect2 role="content" revision="sysv">
|
---|
[e8e3312d] | 507 | <title>Contents</title>
|
---|
| 508 |
|
---|
| 509 | <segmentedlist>
|
---|
| 510 | <segtitle>Installed Programs</segtitle>
|
---|
[54666831] | 511 | <segtitle>Installed Library</segtitle>
|
---|
[e8e3312d] | 512 | <segtitle>Installed Directories</segtitle>
|
---|
| 513 |
|
---|
| 514 | <seglistitem>
|
---|
[0b83a69] | 515 | <seg>
|
---|
[54666831] | 516 | dbus-cleanup-sockets, dbus-daemon, dbus-launch, dbus-monitor,
|
---|
[c358685] | 517 | dbus-run-session, dbus-send, dbus-test-tool,
|
---|
[2cd6717] | 518 | dbus-update-activation-environment, and dbus-uuidgen
|
---|
[0b83a69] | 519 | </seg>
|
---|
| 520 | <seg>
|
---|
[54666831] | 521 | libdbus-1.so
|
---|
[0b83a69] | 522 | </seg>
|
---|
| 523 | <seg>
|
---|
[e20b59be] | 524 | /etc/dbus-1,
|
---|
[79ba2ea] | 525 | /usr/{include,lib}/dbus-1.0,
|
---|
[819a4c7] | 526 | /usr/lib/cmake/DBus1,
|
---|
[e20b59be] | 527 | /usr/share/dbus-1,
|
---|
[819a4c7] | 528 | /usr/share/xml/dbus-1,
|
---|
[e20b59be] | 529 | /usr/share/doc/dbus-&dbus-version;, and
|
---|
[79ba2ea] | 530 | /var/{lib,run}/dbus
|
---|
[0b83a69] | 531 | </seg>
|
---|
[e8e3312d] | 532 | </seglistitem>
|
---|
| 533 | </segmentedlist>
|
---|
| 534 |
|
---|
| 535 | <variablelist>
|
---|
| 536 | <bridgehead renderas="sect3">Short Descriptions</bridgehead>
|
---|
| 537 | <?dbfo list-presentation="list"?>
|
---|
| 538 | <?dbhtml list-presentation="table"?>
|
---|
| 539 |
|
---|
[54666831] | 540 | <varlistentry id="dbus-cleanup-sockets">
|
---|
| 541 | <term><command>dbus-cleanup-sockets</command></term>
|
---|
| 542 | <listitem>
|
---|
| 543 | <para>
|
---|
| 544 | is used to clean up leftover sockets in a directory.
|
---|
| 545 | </para>
|
---|
| 546 | <indexterm zone="dbus dbus-cleanup-sockets">
|
---|
| 547 | <primary sortas="b-dbus-cleanup-sockets">dbus-cleanup-sockets</primary>
|
---|
| 548 | </indexterm>
|
---|
| 549 | </listitem>
|
---|
| 550 | </varlistentry>
|
---|
| 551 |
|
---|
| 552 | <varlistentry id="dbus-daemon">
|
---|
| 553 | <term><command>dbus-daemon</command></term>
|
---|
| 554 | <listitem>
|
---|
| 555 | <para>
|
---|
| 556 | is the <application>D-Bus</application> message bus daemon.
|
---|
| 557 | </para>
|
---|
| 558 | <indexterm zone="dbus dbus-daemon">
|
---|
| 559 | <primary sortas="b-dbus-daemon">dbus-daemon</primary>
|
---|
| 560 | </indexterm>
|
---|
| 561 | </listitem>
|
---|
| 562 | </varlistentry>
|
---|
| 563 |
|
---|
| 564 | <varlistentry id="dbus-launch">
|
---|
[e8e3312d] | 565 | <term><command>dbus-launch</command></term>
|
---|
| 566 | <listitem>
|
---|
[0b83a69] | 567 | <para>
|
---|
| 568 | is used to start <command>dbus-daemon</command> from a shell
|
---|
| 569 | script. It would normally be called from a user's login
|
---|
| 570 | scripts.
|
---|
| 571 | </para>
|
---|
[54666831] | 572 | <indexterm zone="dbus dbus-launch">
|
---|
| 573 | <primary sortas="b-dbus-launch">dbus-launch</primary>
|
---|
| 574 | </indexterm>
|
---|
| 575 | </listitem>
|
---|
| 576 | </varlistentry>
|
---|
| 577 |
|
---|
| 578 | <varlistentry id="dbus-monitor">
|
---|
| 579 | <term><command>dbus-monitor</command></term>
|
---|
| 580 | <listitem>
|
---|
| 581 | <para>
|
---|
| 582 | is used to monitor messages going through a
|
---|
| 583 | <application>D-Bus</application> message bus.
|
---|
| 584 | </para>
|
---|
| 585 | <indexterm zone="dbus dbus-monitor">
|
---|
| 586 | <primary sortas="b-dbus-monitor">dbus-monitor</primary>
|
---|
| 587 | </indexterm>
|
---|
| 588 | </listitem>
|
---|
| 589 | </varlistentry>
|
---|
| 590 |
|
---|
| 591 | <varlistentry id="dbus-run-session">
|
---|
| 592 | <term><command>dbus-run-session</command></term>
|
---|
| 593 | <listitem>
|
---|
| 594 | <para>
|
---|
| 595 | start a process as a new <application>D-Bus</application> session.
|
---|
| 596 | </para>
|
---|
| 597 | <indexterm zone="dbus dbus-run-session">
|
---|
| 598 | <primary sortas="b-dbus-run-session">dbus-run-session</primary>
|
---|
| 599 | </indexterm>
|
---|
| 600 | </listitem>
|
---|
| 601 | </varlistentry>
|
---|
| 602 |
|
---|
| 603 | <varlistentry id="dbus-send">
|
---|
| 604 | <term><command>dbus-send</command></term>
|
---|
| 605 | <listitem>
|
---|
| 606 | <para>
|
---|
| 607 | is used to send a message to a <application>D-Bus</application>
|
---|
| 608 | message bus.
|
---|
| 609 | </para>
|
---|
| 610 | <indexterm zone="dbus dbus-send">
|
---|
| 611 | <primary sortas="b-dbus-send">dbus-send</primary>
|
---|
| 612 | </indexterm>
|
---|
| 613 | </listitem>
|
---|
| 614 | </varlistentry>
|
---|
| 615 |
|
---|
[c358685] | 616 | <varlistentry id="dbus-test-tool">
|
---|
| 617 | <term><command>dbus-test-tool</command></term>
|
---|
| 618 | <listitem>
|
---|
| 619 | <para>
|
---|
[11d14a27] | 620 | is a <application>D-Bus</application> traffic generator and test
|
---|
| 621 | tool; it is a multi-purpose tool for debugging and profiling
|
---|
[c358685] | 622 | <application>D-Bus</application>.
|
---|
| 623 | </para>
|
---|
| 624 | <indexterm zone="dbus dbus-test-tool">
|
---|
| 625 | <primary sortas="b-dbus-test-tool">dbus-test-tool</primary>
|
---|
| 626 | </indexterm>
|
---|
| 627 | </listitem>
|
---|
| 628 | </varlistentry>
|
---|
| 629 |
|
---|
| 630 | <varlistentry id="dbus-update-activation-environment">
|
---|
| 631 | <term><command>dbus-update-activation-environment</command></term>
|
---|
| 632 | <listitem>
|
---|
| 633 | <para>
|
---|
[11d14a27] | 634 | is used to update the environment used for
|
---|
| 635 | <application>D-Bus</application> session services;
|
---|
| 636 | it updates the list of environment variables used by
|
---|
[c358685] | 637 | <command>dbus-daemon --session</command> when it activates session
|
---|
| 638 | services without using systemd.
|
---|
| 639 | </para>
|
---|
| 640 | <indexterm zone="dbus dbus-update-activation-environment">
|
---|
| 641 | <primary sortas="b-dbus-update-activation-environment">
|
---|
| 642 | dbus-update-activation-environment</primary>
|
---|
| 643 | </indexterm>
|
---|
| 644 | </listitem>
|
---|
| 645 | </varlistentry>
|
---|
| 646 |
|
---|
[54666831] | 647 | <varlistentry id="dbus-uuidgen">
|
---|
| 648 | <term><command>dbus-uuidgen</command></term>
|
---|
| 649 | <listitem>
|
---|
| 650 | <para>
|
---|
| 651 | is used to generate a universally unique ID.
|
---|
| 652 | </para>
|
---|
| 653 | <indexterm zone="dbus dbus-uuidgen">
|
---|
| 654 | <primary sortas="b-dbus-uuidgen">dbus-uuidgen</primary>
|
---|
| 655 | </indexterm>
|
---|
| 656 | </listitem>
|
---|
| 657 | </varlistentry>
|
---|
| 658 |
|
---|
| 659 | <varlistentry id="libdbus-1">
|
---|
| 660 | <term><filename class="libraryfile">libdbus-1.so</filename></term>
|
---|
| 661 | <listitem>
|
---|
| 662 | <para>
|
---|
| 663 | contains the API functions used by the
|
---|
| 664 | <application>D-Bus</application> message daemon.
|
---|
| 665 | <application>D-Bus</application> is first a library that provides
|
---|
| 666 | one-to-one communication between any two applications;
|
---|
| 667 | <command>dbus-daemon</command> is an application that uses this
|
---|
| 668 | library to implement a message bus daemon.
|
---|
| 669 | </para>
|
---|
| 670 | <indexterm zone="dbus libdbus-1">
|
---|
| 671 | <primary sortas="c-libdbus-1">libdbus-1.so</primary>
|
---|
[e8e3312d] | 672 | </indexterm>
|
---|
| 673 | </listitem>
|
---|
| 674 | </varlistentry>
|
---|
| 675 |
|
---|
| 676 | </variablelist>
|
---|
| 677 |
|
---|
| 678 | </sect2>
|
---|
[5c9e998] | 679 |
|
---|
| 680 | <sect2 role="content" revision="systemd">
|
---|
| 681 | <title>Contents</title>
|
---|
| 682 |
|
---|
| 683 | <para>
|
---|
| 684 | A list of the installed files, along with their short
|
---|
| 685 | descriptions can be found at
|
---|
[d741dcb] | 686 | <ulink url="&lfs-rootd;/chapter06/dbus.html#contents-dbus"/>.
|
---|
[5c9e998] | 687 | </para>
|
---|
| 688 |
|
---|
| 689 | </sect2>
|
---|
| 690 |
|
---|
[e8e3312d] | 691 |
|
---|
| 692 | </sect1>
|
---|
[0d7900a] | 693 |
|
---|