dbus-1.16.2

Introduction to D-Bus

Even though D-Bus was built in LFS, there are some features provided by the package that other BLFS packages need, but their dependencies didn't fit into LFS.

This package is known to build and work properly using an LFS 12.4 platform.

Package Information

  • Download (HTTP): https://dbus.freedesktop.org/releases/dbus/dbus-1.16.2.tar.xz

  • Download SHA256 Sum: 0ba2a1a4b16afe7bceb2c07e9ce99a8c2c3508e5dec290dbb643384bd6beb7e2

  • Download MD5 sum: 97832e6f0a260936d28536e5349c22e5

  • Download size: 1,090 KB

  • Estimated disk space required: 18,965.0 KB

  • Estimated build time: less than 0.5 SBU

D-Bus Dependencies

Recommended

Optional

Systemd-258.1 (runtime, for registering services launched by D-Bus session daemon as systemd user services);

Installation of D-Bus

Install D-Bus by running the following commands (you may wish to review the meson_options.txt file first and add any additional desired options to the meson setup line below):

meson setup build --prefix=/usr     \
            --buildtype=release    \
            --wrap-mode=nofallback
ninja -C build

See below for test instructions.

Now Install, as the root user:

ninja -C build install
chown -v root:messagebus /usr/libexec/dbus-daemon-launch-helper
chmod -v      4750       /usr/libexec/dbus-daemon-launch-helper

Finally, still as the root user, rename the documentation directory (it only exists if the optional dependencies are satisfied for at least one documentation format) to make it versioned:

if [ -e /usr/share/doc/dbus ]; then
  rm -rf /usr/share/doc/dbus-1.16.2
  mv -v  /usr/share/doc/dbus{,-1.16.2}
fi

Command Explanations

-D intrusive_tests=true: Builds extra parts of the code to support all tests. Do not use on a production build.

-D asserts=true: Enables debugging code to run assertions for statements normally assumed to be true. This prevents a warning that '-D asserts=true' on its own is only useful for profiling and might not give true results for all tests, but adds its own NOTE that this should not be used in a production build.

Configuring D-Bus

Config Files

/etc/dbus-1/session.conf, /etc/dbus-1/system.conf and /etc/dbus-1/system.d/*

Configuration Information

The configuration files listed above should probably not be modified. If changes are required, you should create /etc/dbus-1/session-local.conf and/or /etc/dbus-1/system-local.conf and make any desired changes to these files.

If any packages install a D-Bus .service file outside of the standard /usr/share/dbus-1/services directory, that directory should be added to the local session configuration. For instance, /usr/local/share/dbus-1/services can be added by performing the following commands as the root user:

cat > /etc/dbus-1/session-local.conf << "EOF"
<!DOCTYPE busconfig PUBLIC
 "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
 "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
<busconfig>

  <!-- Search for .service files in /usr/local -->
  <servicedir>/usr/local/share/dbus-1/services</servicedir>

</busconfig>
EOF

D-Bus Session Daemon

There are many methods you can use to start a session daemon using the dbus-launch command. Review the dbus-launch man page for details about the available parameters and options. Here are some suggestions and examples:

  • Add dbus-launch to the line in the ~/.xinitrc file that starts your graphical desktop environment.

  • If you use gdm or some other display manager that calls the ~/.xsession file, you can add dbus-launch to the line in your ~/.xsession file that starts your graphical desktop environment. The syntax would be similar to the example in the ~/.xinitrc file.

  • The examples shown previously use dbus-launch to specify a program to be run. This has the benefit (when also using the --exit-with-x11 parameter) of stopping the session daemon when the specified program is stopped. You can also start the session daemon in your system or personal startup scripts by adding the following lines:

    # Start the D-Bus session daemon
    eval `dbus-launch`
    export DBUS_SESSION_BUS_ADDRESS

    This method will not stop the session daemon when you exit your shell, therefore you should add the following line to your ~/.bash_logout file:

    # Kill the D-Bus session daemon
    kill $DBUS_SESSION_BUS_PID

Contents

A list of the installed files, along with their short descriptions can be found at the section called “D-Bus-1.16.2”.