Howto determine the dbus session address??

Stef Bon stef at
Wed Aug 18 03:41:06 PDT 2010

  On 08/17/2010 05:48 PM, Rui Tiago Cação Matos wrote:
> 2010/8/17 Stef Bon<stef at>:
>> No sorry, I'm afraid you do not understand.
>> The script to find out the dbus address runs under a complete other user
>> (aka root), and
>> the problem here is that it has to find out the dbus session address for all
>> user using my construction.
>> So all the users are known, as well as the display device (for every
>> individual user ).
>> How to determine to dbus session address for these users, to send a message
>> using dbus.notify.
> If yours is a *system* service then it must send its signals on the
> *system* bus. Then, in each session, some daemon (which would
> presumably then notify the user) must listen for said signals on the
> *system* bus.
> Rui
Sorry, again I have to correct here.
I know how dbus works, via system to a session, so you do not have to 
explain me that.

but I've got a sendnotify script (written in python, got it from one 
forum), I've attached it here.
It works only like:

sudo -H -u $userid DBUS_SESSION_BUS_ADDRESS=unix:...... python <path to 
script>/sendnotify -i <some icon> "Device added." "Device Flash_Disk is 

Now as you see, this script needs the DBUS_SESSION_BUS_ADDRESS. And the 
question is , how to determine this when the userid (and display) is 
known. And I do not want to
do something like search in /proc/<pid>/environ, that's a silly sollution.


-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: sendnotify
URL: <>

More information about the dbus mailing list