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