deploy the daemon
Havoc Pennington
hp at redhat.com
Fri Mar 9 14:40:24 PST 2007
Simon Burton wrote:
> I am rather confused about this..
>
> On my local machine I have a dbus app (two programs that use dbus for IPC),
> and everything works fine using:
>
> dbus_bus_get(DBUS_BUS_SESSION, err_addr)
>
> and I find these running processes:
> $ ps ax|grep dbus
> 5406 ? Ss 0:00 /usr/bin/dbus-daemon --system
> 6673 ? Ss 0:00 /usr/bin/ssh-agent /usr/bin/dbus-launch --exit-with-session x-session-manager
> 6676 ? S 0:00 /usr/bin/dbus-launch --exit-with-session x-session-manager
> 6677 ? Ss 0:10 dbus-daemon --fork --print-pid 8 --print-address 6 --session
>
>
> On the target (FC5 x86-64) machine there is no X running, but I see:
>
> $ ps ax|grep dbus
> 2109 ? Ss 0:00 dbus-daemon --system
>
> Can I use this daemon for my app ?
This is the system bus. The --session one is the session bus. The docs
make various attempts to explain this, some may be clearer to you than
others. There's an explanation in here:
http://www.freedesktop.org/wiki/IntroductionToDBus
and in here:
http://dbus.freedesktop.org/doc/dbus-tutorial.html
and a third attempt:
http://doc.trolltech.com/4.2/intro-to-dbus.html
In short, there is a session bus for every X login session, and a single
system bus for the whole machine shared among all users.
> I don't seem to be able to
> request a name (dbus_bus_request_name) when I use
> dbus_bus_get(DBUS_BUS_SYSTEM, err_addr).
The system bus is locked down by security policies, these can be found
in /etc/dbus-1/system.d and there is documentation in "man dbus-daemon"
To use the system bus you need to install a security policy to allow
your application through in an appropriate way.
Which bus to use depends on what you're doing. You can also skip using a
bus and just have two apps talk to each other, by running your own
"DBusServer" in one of the apps.
Havoc
More information about the dbus
mailing list