dbus-send error
Alban Crequy
alban.crequy at collabora.co.uk
Wed Oct 6 02:55:48 PDT 2010
Le Wed, 6 Oct 2010 14:34:10 +0530,
Mandeep Sandhu <mandeepsandhu.chd at gmail.com> a écrit :
> signal sender=org.freedesktop.DBus -> dest=(null destination)
> serial=47 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus;
> member=NameOwnerChanged
> string ":1.22"
> string ""
> string ":1.22"
> signal sender=org.freedesktop.DBus -> dest=(null destination)
> serial=48 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus;
> member=NameOwnerChanged
> string ":1.22"
> string ":1.22"
> string ""
>
> * Why are there TWO messages corresponding to my single dbus-send
> cmd...is it some sort of req-reply pair?
NameOwnerChanged has 3 parameters described here:
http://dbus.freedesktop.org/doc/dbus-specification.html#bus-messages-name-owner-changed
The first signal 'NameOwnerChanged' means the unique name ":1.22" has
been acquired by dbus-send. The second signal 'NameOwnerChanged' means
the unique name is no longer in use (when the command dbus-send exits).
Your dbus-monitor logs don't show the D-Bus message sent by dbus-send,
probably because you use the system bus and by default, eavesdropping
is disabled. Do you use the system bus intentionally? You could use the
session bus which has eavesdropping enabled by default.
For debugging purpose, you can edit your system.conf to allow
eavesdropping:
1. replace the policy section by:
<policy context="default">
<!-- Allow everything to be sent -->
<allow send_destination="*" eavesdrop="true"/>
<!-- Allow everything to be received -->
<allow eavesdrop="true"/>
<!-- Allow anyone to own anything -->
<allow own="*"/>
<!-- XXX: Allow all users to connect -->
<allow user="*"/>
</policy>
2. Remove the includedir line:
<includedir>system.d</includedir>
Then, eavesdropping with dbus-monitor should work correctly.
> * Why is the 'dest' field null when I'm setting it to
> org.freedesktop.DBus?
The NameOwnerChanged signals is not what is sent by your
command ../dbus-send but by dbus-daemon itself, so what you specify in
--dest does not change anything here. D-Bus signals in general are not
sent to a specific destination (i.e. the destination is "null") but to
any peers who want to listen to them with match rules.
--
Alban
More information about the dbus
mailing list