[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

dbus questions



Hi,

I have two questions about D-BUS

1. Primary/secondary owners

I have just submitted a patch to udev to send out a D-BUS signal when a device
node is created / destroyed. As multiple copies of udev may run simultaneously, and
frequently do (normally when hot-plugging, say, usb-storage both sda and sda1 is
created), they race to become the owner of the service org.kernel.udev from where
I want to emit the signal. My understanding in this situation is that one of the
copies is the primary owner while the other copy becomes the secondary owner.


It turns out that when intercepting the signal from the secondary owner (I guess)
then the owner of the service emitting it is reported to be a base service, e.g.
:xyz instead of the service that it is secondary owner of, e.g. org.kernel.udev.


This is a problem because then clients listening for these signals cannot filter
on which service the signal originated from. This is a potential security issue.


Is this a bug or a feature?

2. Message dependencies

I have an situation where I know that I will receive several messages, but one of
the early messages need to wait for a later message to have been processed,
before the early message itself can be processed (possibly with some timeout).


How is this easiest achieved? I suppose the only answer is go multithreaded (even
though I really want to avoid this); Is D-BUS designed to do this? I can't seem to
find anything useful about this in the docs..


(it's actually for the hal project where I want hotplug events to be transformed
into D-BUS messages. Now, linux 2.6 is known to give hotplug events out of order,
for instance the USB interfaces are added quite a bit earlier that the USB devices
they belong to. Today it's not a problem as I run a separate copy of the same
program to process each hotplug event and each of these processes can sleep until
the desired situation has occurred.)


Thanks,
David



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]