[dbus]How to verify the capability of dbus IPC between machines

Pavel Strashkin pavel.strashkin at gmail.com
Tue Nov 29 19:53:57 PST 2011


It only means that you can't use --address and --system (--session)
command line options together. --system and --session is kind of alias
for --address.

Try the following call: dbus-send --address=... --print-reply
--type=method_call --dest=org.freedesktop.DBus /org/freedesktop/DBus
org.freedesktop.DBus.ListNames

Put right address there. Also try the same call on localhost where
you're listening on 12434 port, use 127.0.0.1 or localhost as a host
name.

2011/11/29 yinxb <yinxiaobiao at gmail.com>:
> It seems the host(remote pc) is listenning the 12434 port.
>
> another question,when I execute the following command
> dbus-send --address=tcp:host=10.239.58.116,port=12434 --system
> --type=method_call --print-reply --dest=org.gnome.DisplayManager
> /org/gnome/DisplayManager/Manager
> org.gnome.DisplayManager.Manager.GetDisplays
>
> Get the messages:
> ----------------------
> --address" may not be used with "--system" or "--session"
> ---------------------
> Does it mean remote dbus cannot call system bus and session bus in host?
> and then what kind of bus can be used in the remote case?
>
> ps:
> DisplayManager is system bus
>
> 在 2011年11月30日 上午10:04,yinxb <yinxiaobiao at gmail.com> 写道:
>> get the following list in local PC
>> ----------------------
>> tcp        0      0 0.0.0.0:2049            0.0.0.0:*
>> LISTEN      -
>> tcp        0      0 0.0.0.0:59747           0.0.0.0:*
>> LISTEN      -
>> tcp        0      0 0.0.0.0:40967           0.0.0.0:*
>> LISTEN      1554/dbus-daemon
>> tcp        0      0 0.0.0.0:111             0.0.0.0:*
>> LISTEN      617/portmap
>> tcp        0      0 0.0.0.0:22              0.0.0.0:*
>> LISTEN      586/sshd
>> tcp        0      0 127.0.0.1:631           0.0.0.0:*
>> LISTEN      984/cupsd
>> tcp        0      0 0.0.0.0:59962           0.0.0.0:*
>> LISTEN      699/rpc.statd
>> tcp        0      0 0.0.0.0:52732           0.0.0.0:*
>> LISTEN      927/rpc.mountd
>> tcp        0      0 0.0.0.0:60317           0.0.0.0:*
>> LISTEN      1768/dbus-daemon
>> tcp6       0      0 :::22                   :::*
>> LISTEN      586/sshd
>> tcp6       0      0 ::1:631                 :::*
>> LISTEN      984/cupsd
>> --------------------------
>>
>> in remotePC
>> -------------------------
>> tcp        0      0 0.0.0.0:2049            0.0.0.0:*
>> LISTEN      -
>> tcp        0      0 0.0.0.0:53097           0.0.0.0:*
>> LISTEN      770/rpc.statd
>> tcp        0      0 0.0.0.0:34474           0.0.0.0:*
>> LISTEN      1125/rpc.mountd
>> tcp        0      0 0.0.0.0:111             0.0.0.0:*
>> LISTEN      730/portmap
>> tcp        0      0 0.0.0.0:12434           0.0.0.0:*
>> LISTEN      512/dbus-daemon
>> tcp        0      0 0.0.0.0:33267           0.0.0.0:*
>> LISTEN      -
>> tcp        0      0 0.0.0.0:22              0.0.0.0:*
>> LISTEN      1559/sshd
>> tcp        0      0 127.0.0.1:631           0.0.0.0:*
>> LISTEN      1380/cupsd
>> tcp6       0      0 :::22                   :::*
>> LISTEN      1559/sshd
>> tcp6       0      0 ::1:631                 :::*
>> LISTEN      1380/cupsd
>> -------------------------
>> 2011/11/30, Pavel Strashkin <pavel.strashkin at gmail.com>:
>>> What about "netstat -nlpt"? Does it show that some process is
>>> listening on 12434 TCP/IP port?
>>>
>>> 2011/11/29 yinxb <yinxiaobiao at gmail.com>:
>>>> Hi Pavel Strashkin
>>>>
>>>>    It seems that dbus-monitor did not connect the specified host & port.
>>>>
>>>>    When execute the  command in remotePC or lolcaPC:
>>>>    dbus-monitor --address tcp:host=xx.xxx.xx.116,port=12434
>>>>     only get the register failed message
>>>> ========
>>>> Failed to register connection to bus at
>>>> tcp:host=10.239.58.116,port=12434: Did not receive a reply. Possible
>>>> causes include: the remote application did not send a reply, the
>>>> message bus security policy blocked the reply, the reply timeout
>>>> expired, or the network connection was broken.
>>>> ========
>>>>   I even turned off the firewall on both remotePC and localPC and
>>>> still get the same result.
>>>>
>>>> 在 2011年11月30日 上午3:34,Pavel Strashkin <pavel.strashkin at gmail.com> 写道:
>>>>> Does dbus-monitor successfully connect to dbus-daemon on specified host &
>>>>> port?
>>>>>
>>>>> 2011/11/28 yinxb <yinxiaobiao at gmail.com>:
>>>>>> In addition,dbus-monitor in the remote PC cannot find any info related
>>>>>> the dbus-send.
>>>>>>
>>>>>> 在 2011年11月29日 上午10:38,yinxb <yinxiaobiao at gmail.com> 写道:
>>>>>>> Hi  Thiago Macieira and Pavel
>>>>>>>
>>>>>>>     Thanks for your reply.
>>>>>>>
>>>>>>>     As metioned in your mail,I did the following steps:
>>>>>>> 1.Romote PC:
>>>>>>>   Config /etc/dbus-1/system.conf.
>>>>>>>   Add listen tcp:host=0.0.0.0,port=12434
>>>>>>>
>>>>>>> 2.Local PC:
>>>>>>>   dbus-send --address=tcp:host=xx.xxx.xx.116,port=12434 --print-reply
>>>>>>>  --dest=org.gnome.PowerManager
>>>>>>> /org/ayatana/NotificationItem/gnome_power_manager/Menu
>>>>>>> org.freedesktop.Dbus.Introspectable.Introspect
>>>>>>>
>>>>>>> after that,I got the following message:
>>>>>>> Error org.freedesktop.DBus.Error.NoReply: Did not receive a reply.
>>>>>>> Possible causes include: the remote application did not send a reply,
>>>>>>> the message bus security policy blocked the reply, the reply timeout
>>>>>>> expired, or the network connection was broken.
>>>>>>>
>>>>>>> Can you figure out what is missing or wrong with my steps?
>>>>>>>
>>>>>>> ps:
>>>>>>> telnet can connect the remote PC (xx.xxx.xx.116).
>>>>>>>
>>>>>>> 2011/11/29 Thiago Macieira <thiago at kde.org>:
>>>>>>>> On Monday, 28 de November de 2011 15.59.42, 尹YinXiaobiao wrote:
>>>>>>>>> Hi all
>>>>>>>>>      I am a newbie at Dbus and this is my first mail in this
>>>>>>>>> maillist.
>>>>>>>>>     By some investigate and look at the source code,I know that dbus
>>>>>>>>> is using socket(tcp & unix domain socket) to transfer data.
>>>>>>>>>     So it is possible for communication between two machines(or VM).
>>>>>>>>
>>>>>>>> Right, it's possible.
>>>>>>>>
>>>>>>>>>     Now my question is how to vevify this capability by dbus-send
>>>>>>>>> command.
>>>>>>>>>     Can anyone give me  a hint?
>>>>>>>>
>>>>>>>> Just send the message you want to send. You know the address of the
>>>>>>>> bus server
>>>>>>>> to connect to, so pass it in the --address= option. You know that
>>>>>>>> address
>>>>>>>> because you configured the other machine with it.
>>>>>>>>
>>>>>>>>> Someone tell me that dbus do not listen on TCP by default,how to
>>>>>>>>> enable TCP listen?
>>>>>>>>
>>>>>>>> Create your own config file and change the <listen> directive to be on
>>>>>>>> TCP.
>>>>>>>>
>>>>>>>> Remember: D-Bus TCP is unauthenticated an unencrypted. It accepts
>>>>>>>> connections
>>>>>>>> from anywhere and trusts it blindly.
>>>>>>>>
>>>>>>>> --
>>>>>>>> Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
>>>>>>>>   Software Architect - Intel Open Source Technology Center
>>>>>>>>      PGP/GPG: 0x6EF45358; fingerprint:
>>>>>>>>      E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358
>>>>>>>>
>>>>>>>> _______________________________________________
>>>>>>>> dbus mailing list
>>>>>>>> dbus at lists.freedesktop.org
>>>>>>>> http://lists.freedesktop.org/mailman/listinfo/dbus
>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>> _______________________________________________
>>>>>> dbus mailing list
>>>>>> dbus at lists.freedesktop.org
>>>>>> http://lists.freedesktop.org/mailman/listinfo/dbus
>>>>>>
>>>>
>>>
>


More information about the dbus mailing list