Dbus: Как я могу контролировать процесс?

876
user590536

Я новичок в Dbus, и мне любопытно, есть ли способ контролировать процесс и видеть, получает ли этот процесс какие-либо сообщения Dbus. (Я работаю над некоторым проектом и хочу знать, получает ли Xserver какие-либо сообщения Dbus при выходе из системы). Большое спасибо.

0
Какая у вас версия dbus? grawity 7 лет назад 0
D-Bus Message Bus Daemon 1.6.18 user590536 7 лет назад 0

1 ответ на вопрос

0
duDE

Take a look at this WIKI article:

There are two buses commonly used: the session bus and the system bus. Either may be used by any application, depending on what it is doing.

  • To monitor the session bus: dbus-monitor
  • To monitor the system bus:

create a file /etc/dbus-1/system-local.conf, with these contents:

<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-Bus Bus Configuration 1.0//EN" "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd"> <busconfig> <policy user="root"> <allow eavesdrop="true"/> <allow eavesdrop="true" send_destination="*"/> </policy> </busconfig> 

Reboot your machine to pick up the configuration changes. Simply reloading the DBus server configuration is not sufficient. For further info see this bug.

Now run dbus-monitor as root. You should be able to see all signals, method calls, and method replies.

sudo dbus-monitor --system 

When done debugging, it is wise to remove the policy snippet:

sudo rm /etc/dbus-1/system-local.conf 
Я видел эту статью, но как я могу разобрать сообщения, только зная имя процесса назначения? user590536 7 лет назад 0
К счастью, инструкции по подслушиванию больше не нужны в dbus 1.10 (в прошлом они вызывали некоторые странные побочные эффекты). grawity 7 лет назад 1

Похожие вопросы