System vs. session bus

wolfy wolfgang_a_h at gmx.at
Sat Feb 14 14:24:12 PST 2009


Hi all,
following etiquette, of course I searched the forums first :-)
and found this:
http://www.nabble.com/Accessing-Session-Bus-through-the-superuser-td16084114.html
Accessing Session Bus through the superuser 

However, this does not answer my question, which is slightly different:

I wrote a simple notification icon for the (gnome-)systray. When a certain
(python-)script is called, this icon changes state.
The script can be called in one of two ways:
* As callback from the network manager (i.e. as root)
* As normal user prior to starting an application (i.e. as current user)

My systray notification icon exports its API (two simple "on"/"off" methods)
to the session dbus, which works great when the script is called as current
user.
When the script is called by the network manager, these methods are (not
surprisingly...) not found on the session dbus (which is now the root
user's).

Either I have to access the session dbus from the root account (which is
discussed in the aforementioned thread and is as it seems not a good idea
and/or not possible).
Or I have to export the methods on the system bus, which does not sound like
a good practice to me (or is it?), as the notification icon is not really a
system service... just out of interest, I tried this approach and came
across the issue, that the script, run as normal user, was not allowed to
connect/export to the system bus... I have not resolved this right now, but
I'm sure it's easily possible by tweaking some dbus privilege settings - I
just started using the dbus for  the first time 3 hours ago, so I'm happy
with the progress made *so* far ;-) and I will only follow this approach
after my Q is answered:

Which is the better or best option:
1) Letting the systray icon connect to the system dbus?
2) Trying to work around the problem that the script run as root cannot
connect to the user's session dbus (if possible at all)?
3) some other option(s) I have overlooked so far?

Thanks in advance!
Greetings & cheers
-- 
View this message in context: http://www.nabble.com/System-vs.-session-bus-tp21904161p21904161.html
Sent from the Free Desktop - dbus mailing list archive at Nabble.com.



More information about the dbus mailing list