D-Bus is killing me
Matthew Johnson
dbus at matthew.ath.cx
Sun Dec 17 11:40:53 PST 2006
On Sun, 17 Dec 2006, Mystilleef wrote:
>
I'm not a python bindings specialist, so these comments are from a
general point of view.
> 2). Doesn't like Root and I don't know why.
>
> My application won't run as root because of D-Bus. I get this cryptic
> error message everytime I attempt to run it as root:
Generally you cannot access a session bus as root. This is because root
normally doesn't run a session bus and you cannot connect to the session
bus as any user other than the one which owns it. sudo <dbus process>
just doesn't work. This is a security measure.
If you are trying to access a user's bus, this just won't work. If you
aren't, then it's likely there just isn't a bus running as root with
DBUS_SESSION_BUS_ADDRESS set appropriately. I agree the error message
isn't great. This is, as you surmise, mostly down to the python
bindings.
> 3). D-Bus Isn't re-entrant.
>
D-Bus isn't re-entrant by default, but can be made to be so, depending
how you use it. The general approaches are either: use lots of threads
so that it doesn't matter that you are blocking on calls---this is the
approach the Java bindings take, or use asynchronous calls. If you
expect that there could be any re-entrancy then you should call the
method asynchronously and then call back into the mainloop while waiting
for it to complete.
Lastly, you said you were trying to do dbus calls within the same
process. Most of the time as has been said, there's not a lot of reason
for doing this, since you can just call the methods directly (of course
there are exceptions).
HTH
Matt
--
Matthew Johnson
http://www.matthew.ath.cx/
More information about the dbus
mailing list