参考URL
DBusイントロスペクション メモ
D-Bus の存在を感じてみる
概要
・メッセージバスと呼ばれる、アプリケーション間でやりとりを行うための、プロセス間通信(IPC)実装のひとつ
・system busとsession busがあり殆どのサービスはどちらかのバスに接続されている
・dbus は systemd の依存パッケージ
・d-feetを利用しようとしたが、GUIツールでCUIでは動作させられなかった
コマンド
root@hostname:/home/shimizu# apt-file search /usr/bin/dbus-daemon
dbus: /usr/bin/dbus-daemon
root@hostname:/home/shimizu# dpkg -S /usr/bin/dbus-daemon
dbus: /usr/bin/dbus-daemon
root@hostname:/home/shimizu# dbus-send --system --dest=org.freedesktop.DBus --type=method_call --print-reply /org/freedesktop/DBus org.freedesktop.DBus.Introspectable.Introspect
method return sender=org.freedesktop.DBus -> dest=:1.41 reply_serial=2
string "<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//
EN"
"http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
<node>
<interface name="org.freedesktop.DBus">
<method name="Hello">
<arg direction="out" type="s"/>
</method>
<method name="RequestName">
...
# 存在するバス名の一覧を表示する
root@hostname:/home/shimizu# dbus-send --system --dest=org.freedesktop.DBus --type=method_call --print-reply /org/freedesktop/DBus org.freedesktop.DBus.ListNames
method return sender=org.freedesktop.DBus -> dest=:1.18 reply_serial=2
array [
string "org.freedesktop.DBus"
string "org.freedesktop.login1"
string ":1.3"
string "org.freedesktop.systemd1"
string ":1.4"
string ":1.18"
]
root@hostname:/home/shimizu# dbus-send --system --dest=org.freedesktop.systemd1 --type=method_call --print-reply /org/freedesktop/systemd1 org.freedesktop.DBus.Introspectable.Introspect
method return sender=:1.3 -> dest=:1.62 reply_serial=2
string "<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN"
"http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
<node>
<interface name="org.freedesktop.DBus.Peer">
<method name="Ping"/>
<method name="GetMachineId">
<arg type="s" name="machine_uuid" direction="out"/>
...
# interfaceに"org.freedesktop.DBus.Peer"を指定し、methodに"Ping"を指定する
root@hostname:/home/shimizu# dbus-send --system --dest=org.freedesktop.systemd1 --type=method_call --print-reply /org/freedesktop/systemd1 org.freedesktop.DBus.Peer.Ping
method return sender=:1.3 -> dest=:1.63 reply_serial=2