D-Bus-1.16.2

#### Gaming Linux® From Scratch - Version 13.0

### Chapter 8. Basic X11 Software

- Prev

  XCB Utils

- Next

  libunwind-1.8.3

- Up
- Home

# D-Bus-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 GLFS packages need, but their dependencies didn't fit into LFS.

- Download: https://dbus.freedesktop.org/releases/dbus/dbus-1.16.2.tar.xz

### D-Bus Dependencies

Recommended
Xorg Libraries (for dbus-launch program)
Optional
Systemd-259.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 desired parameters to the meson command shown below):

    mkdir  build &&
    cd     build &&

    meson setup --prefix=/usr          \
                --buildtype=release    \
                --wrap-mode=nofallback \
                .. &&

    ninja

Now, as the `root` user:

    ninja install

If you are using a DESTDIR install, dbus-daemon-launch-helper needs to be fixed afterwards. Issue the following as the `root` user:

    chown -v root:messagebus /usr/libexec/dbus-daemon-launch-helper &&
    chmod -v      4750       /usr/libexec/dbus-daemon-launch-helper

## Command Explanations

### Note

Inspect `meson_options.txt` or `meson.options` for a full list of options.

`--wrap-mode=nofallback`: This switch prevents meson from using subproject fallbacks for any dependency declarations in the build files, stopping it downloading any optional dependency which is not installed on the system.

## 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

Now would be a good idea to reboot and test to see if D-Bus, logind, etc. works, and you can login. Run the command loginctl after ensuring D-Bus is running. The result should indicate that a SESSION and a SEAT have been created.

## Contents

Installed Programs: dbus-cleanup-sockets, dbus-daemon, dbus-launch, dbus-monitor, dbus-run-session, dbus-send, dbus-test-tool, dbus-update-activation-environment, and dbus-uuidgen
Installed Library: libdbus-1
Installed Directories: /etc/dbus-1, /usr/{include,lib}/dbus-1.0, /usr/lib/cmake/DBus1, /usr/share/dbus-1, /usr/share/xml/dbus-1, /usr/share/doc/dbus-1.16.2, and /var/{lib,run}/dbus

### Short Descriptions

dbus-cleanup-sockets | is used to clean up leftover sockets in a directory
dbus-daemon | is the D-Bus message bus daemon
dbus-launch | is used to start dbus-daemon from a shell script. It would normally be called from a user's login scripts
dbus-monitor | is used to monitor messages going through a D-Bus message bus
dbus-run-session | starts a process as a new D-Bus session
dbus-send | is used to send a message to a D-Bus message bus
dbus-test-tool | is a D-Bus traffic generator and test tool; it is a multi-purpose tool for debugging and profiling D-Bus
dbus-update-activation-environment | is used to update the environment used for D-Bus session services; it updates the list of environment variables used by dbus-daemon --session when it activates session services without using systemd
dbus-uuidgen | is used to generate a universally unique ID
`libdbus-1` | contains the API functions used by the D-Bus message daemon. D-Bus is first a library that provides one-to-one communication between any two applications; dbus-daemon is an application that uses this library to implement a message bus daemon

- Prev

  XCB Utils

- Next

  libunwind-1.8.3

- Up
- Home