dbus-1.12.10

D-Bus の概要

D-Bus is a message bus system, a simple way for applications to talk to one another. D-Bus supplies both a system daemon (for events such as 「new hardware device added」 or 「printer queue changed」) and a per-user-login-session daemon (for general IPC needs among user applications). Also, the message bus is built on top of a general one-to-one message passing framework, which can be used by any two applications to communicate directly (without going through the message bus daemon).

本パッケージは LFS-8.3 において正しくビルドでき動作することが確認されています。

パッケージ情報

D-Bus の依存パッケージ

推奨

任意

テストのために: dbus-glib-0.110, D-Bus Python-1.2.8, PyGObject-3.28.3, and Valgrind-3.13.0; ドキュメント生成のために: Doxygen-1.8.14, xmlto-0.0.28, Ducktype, Yelp Tools

ユーザー情報: http://wiki.linuxfromscratch.org/blfs/wiki/dbus

D-Bus のインストール

以下のシステムユーザーとグループがまだ存在していない場合は root ユーザーになって生成します。 これはシステムメッセージバスの処理を取り扱うためです。

groupadd -g 18 messagebus &&
useradd -c "D-Bus Message Daemon User" -d /var/run/dbus \
        -u 18 -g messagebus -s /bin/false messagebus

以下のコマンドを実行して D-Bus をビルドします。 (configure コマンドに対しては、以下に示すパラメーター以外のものも必要になるかもしれません。 実行する前に ./configure --help を実行して出力内容を確認してください。)

./configure --prefix=/usr                        \
            --sysconfdir=/etc                    \
            --localstatedir=/var                 \
            --disable-doxygen-docs               \
            --disable-xml-docs                   \
            --disable-static                     \
            --docdir=/usr/share/doc/dbus-1.12.10 \
            --with-console-auth-dir=/run/console \
            --with-system-pid-file=/run/dbus/pid \
            --with-system-socket=/run/dbus/system_bus_socket &&
make

テスト方法については後述を参照ください。

root ユーザーになって以下を実行します。

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

If you are still building your system in chroot or you did not start the daemon yet, but you want to compile some packages that require D-Bus, generate D-Bus UUID to avoid warnings when compiling some packages with the following command as the root user:

dbus-uuidgen --ensure

The dbus tests cannot be run until after dbus-glib-0.110 has been installed. They must be run as an unprivileged user from a local session with bus address. To run the standard tests issue make check.

If you want to run the unit regression tests, configure requires additional parameters which expose additional functionality in the binaries that are not intended to be used in a production build of D-Bus. If you would like to run the tests, issue the following commands (for the tests, you don't need to build the docs):

make distclean                     &&
./configure --enable-tests         \
            --enable-asserts       \
            --disable-doxygen-docs \
            --disable-xml-docs     &&
make                               &&
make check

The test test-bus.sh is known to fail. There has also been reports that the tests may fail if running inside a Midnight Commander shell. You may get out-of-memory error messages when running the tests. These are normal and can be safely ignored.

コマンド説明

--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: このスイッチはスタティックライブラリをインストールしないようにします。

--disable-systemd: This switch disables systemd support in D-Bus.

--without-systemdsystemunitdir: This switch prevents installation of systemd unit files.

--with-console-auth-dir=/run/console/: This parameter specifies location of the ConsoleKit auth dir.

--with-system-pid-file=/run/dbus/pid: This parameter specifies the location of the PID file.

--with-system-socket=/run/dbus/system_bus_socket: This parameter specifies the location of the system bus socket.

--enable-tests: Build extra parts of the code to support all tests. Do not use on a production build.

--enable-embedded-tests: Build extra parts of the code to support only unit tests. Do not use on a production build.

--enable-asserts: Enable 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.

D-Bus の設定

設定ファイル

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

設定情報

上に示している設定ファイルは編集すべきではありません。 変更が必要な場合は /etc/dbus-1/session-local.conf/etc/dbus-1/system-local.conf に対して必要な変更を加えます。

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

システムブート時に dbus-daemon を自動起動させるために、blfs-bootscripts-20180105 パッケージからブートスクリプト /etc/rc.d/init.d/dbus をインストールします。

make install-dbus

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:

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

  • If you use xdm 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-session 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
    
  • A hint has been written that provides ways to start scripts using the KDM session manager of KDE. The concepts in this hint could possibly be used with other session managers as well. The hint is located at http://www.linuxfromscratch.org/hints/downloads/files/execute-session-scripts-using-kdm.txt.

パッケージ構成

インストールプログラム: dbus-cleanup-sockets, dbus-daemon, dbus-launch, dbus-monitor, dbus-run-session, dbus-send, dbus-test-tool, dbus-update-activation-environment, dbus-uuidgen
インストールライブラリ: libdbus-1.so
インストールディレクトリ: /etc/dbus-1, /usr/{include,lib}/dbus-1.0, /usr/share/dbus-1, /usr/share/doc/dbus-1.12.10, /var/{lib,run}/dbus

概略説明

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

start 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.so

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.

最終更新日: 2018-08-19 06:53:19 +0900