Detecting dbus session

Dan Williams dcbw at redhat.com
Sun Oct 28 05:10:37 UTC 2007


On Sat, 2007-10-27 at 22:54 -0400, Jesse Keating wrote:
> I'm trying to write a couple NetworkManager Dispatcher calls to futz
> with a few things that don't yet have NM capabilities.  However I'm
> running into a snag, particularly with pidgin.  Pidgin has a
> purple-remote call that uses dbus.  nm-dispatcher runs as root so I
> have to switch to my user to accomplish things (currently via su -
> <user> -c "command args").  Seems though that a 'su - <user>' from root
> doesn't add the DBUS_SESSION_BUS_ADDRESS env entry, and purple-remote
> can't find dbus or can't find pidgin on the bus.
> 
> How can I programmatically figure out what the dbus address is, or
> otherwise accomplish what I'm trying to do?

This sounds pretty wrong; root isn't supposed to know about the session
bus, and you're going to have a very hard time finding out the address
of some random user session bus by design.

If you want to do stuff from your user session, the best bet is to have
a session-bus dispatcher daemon.  Can you just clone the DBus Example
Plugin from pidgin and make it do what you want?

dan





More information about the Fedora-desktop-list mailing list