Process monitoring using D-Bus server client model

Havoc Pennington hp at pobox.com
Mon Jun 2 13:00:07 PDT 2008


Hi,

I don't know the answers on dbus-glib but some partial answers -

On Mon, Jun 2, 2008 at 12:01 AM, João Valverde <backup95 at netcabo.pt> wrote:
> auto generates some signal for that or what. Maybe I need to keep two
> proxies for that, one to the bus and the other to the daemon? And what
> are the signal names that I should connect to? All I see using
> dbus-monitor is "NameOwnerChanged", even when my daemon dies. If I only
> allow a single daemon instance to run and accept replacement, there are
> situations where I don't care if the name owner changes (reloading a
> config file without downtime for example)...

NameOwnerChanged is the correct way to track when other processes come
and go. Just ignore any changes you don't care about.

> I would also like to ask if it's considered good practice to
> indiscriminately broadcast events to the system bus, even if no one is
> listening (my daemon could potentially generate a lot of traffic...) or
> whether I should set up a one-on-one connection? Maybe do a handshake
> over the system bus and then set up a peer to peer connection?

The bus daemon will do a good job of only sending messages to clients
that care about them. If there are no interested clients, then the
messages will just be dropped by the daemon. So, as long as you aren't
shoveling huge hunks of data around, the one-to-one connection is
definitely not worth it.

Havoc


More information about the dbus mailing list