how to "discover" the session bus

Thiago Macieira thiago at kde.org
Tue Apr 8 14:28:22 PDT 2008


Ross Burton wrote:
>On Tue, 2008-04-08 at 11:08 -0700, Shawn Rutledge wrote:
>> I'm getting started with libdbus (developing a Scheme binding).
>>
>> On OpenMoko the issue has come up, how to "discover" the bus address
>> of the already-running session daemon.  /etc/X11/Xsession starts the
>> daemon, so inside that X session it is accessible, but what if you ssh
>> to the phone or otherwise get another shell?  I modified Xsession to
>> do this
>
>Set $DISPLAY and let DBus find the session bus by looking at the
>properties DBus sets on the root window?

That currently works only as long as the D-Bus session was autolaunched as 
well. If someone used dbus-launch directly, chances are that the 
information is not on the X11 window.

(Technically speaking, it's not the root window. When in autolaunch mode, 
dbus-launch creates a selection atom and assigns it to its own window; in 
that window, it keeps two properties: the PID and the session address. 
The discovery process is to obtain the WId of the selection atom and then 
get the well-known properties from that window. If dbus-launch crashes, 
the information disappears automatically -- no stale info on the root 
window)

-- 
  Thiago Macieira  -  thiago (AT) macieira.info - thiago (AT) kde.org
    PGP/GPG: 0x6EF45358; fingerprint:
    E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
Url : http://lists.freedesktop.org/archives/dbus/attachments/20080408/a8b84dce/attachment-0001.pgp 


More information about the dbus mailing list