Introduction to D-Bus - Pass 2
D-Bus was already compiled before, but not a useful program,
dbus-launch. This
pass will cover it, and some setup required.
D-Bus Dependencies
Recommended
Xorg
Libraries (for dbus-launch program)
Installation of D-Bus - Pass 2
Install D-Bus by running the
following commands (you may wish to review the output from
./configure --help
first and add any desired parameters to the configure command shown below):
make distclean &&
./configure --prefix=/usr \
--sysconfdir=/etc \
--localstatedir=/var \
--runstatedir=/run \
--disable-doxygen-docs \
--disable-xml-docs \
--disable-static \
--with-systemduserunitdir=no \
--with-systemdsystemunitdir=no \
--docdir=/usr/share/doc/dbus-1.14.10 \
--with-system-socket=/run/dbus/system_bus_socket &&
make
Now, as the root user:
make install
If you are using a DESTDIR install, dbus-daemon-launch-helper needs
to be fixed afterwards. Issue, as root user:
chown -v root:messagebus /usr/libexec/dbus-daemon-launch-helper &&
chmod -v 4750 /usr/libexec/dbus-daemon-launch-helper
Command Explanations
--disable-doxygen-docs:
This switch disables doxygen documentation build and install, if
you have doxygen installed. If
doxygen is installed, and you wish
to build them, remove this parameter.
--disable-xml-docs: This
switch disables html documentation build and install, if you have
xmlto installed. If xmlto is installed, and you wish to build
them, remove this parameter.
--disable-static: This
switch prevents installation of static versions of the libraries.
--with-systemd{user,system}unitdir=no:
These switches disable installation of systemd units on elogind
based systems.
--with-system-socket=/run/dbus/system_bus_socket:
This parameter specifies the location of the system bus socket.
--enable-tests: Builds
extra parts of the code to support all tests. Do not use on a
production build.
--enable-embedded-tests: Builds extra
parts of the code to support only unit tests. Do not use on a
production build.
--enable-asserts: Enables
debugging code to run assertions for statements normally assumed to
be true. This prevents a warning that '--enable-tests' 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
To automatically start dbus-daemon when the system is
rebooted, install the /etc/rc.d/init.d/dbus bootscript from the
blfs-bootscripts package.
make install-dbus
Now would be a good idea to reboot and test to see if D-Bus,
elogind, 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.
Note that this boot script only starts the system-wide
D-Bus daemon. Each user
requiring access to D-Bus
services will also need to run a session daemon as well. 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: