Re: How does dbus-daemon handle multiple services with same Name?

"Armin K." <[email protected]>
Newsgroups gmane.comp.freedesktop.dbus
Message-ID <[email protected]>
On 06/21/2015 09:11 PM, Michael Biebl wrote:
> 2015-06-21 20:58 GMT+02:00 Armin K. <[email protected]>:
>> On 06/21/2015 08:42 PM, Lennart Poettering wrote:
>>> On Sun, 21.06.15 13:02, Armin K. ([email protected]) wrote:
>>>
>>>> Hi,
>>>>
>>>> While trying kdbus with systemd, I have ran across a problem.
>>>> Apparently it doesn't yet properly handle multiple D-Bus services
>>>> with same name.
>>>>
>>>> I'm interested in how does D-Bus daemon handle this? Which one
>>>> gets loaded and how it decides which one to load?
>>>>
>>>> An example:
>>>>
>>>> I have two services with Name=org.freedesktop.FileManager1
>>>>
>>>> One is GNOME's Nautilus, other is MATE's Caja File Manager.
>>>> Which one would get loaded and why?
>>>
>>> Only one service can own a name at a time. If one already owns a name,
>>> and another one tries to take possession of it as well, then one of
>>> three things can happen:
>>>
>>>       a) the request to own the name is queued, and dbus-daemon passes
>>>       it on automatically and atomically as soon as the old owner
>>>       voluntarily gives it up.
>>>
>>>       b) the operation to request the name will simply fail (this mode
>>>       of operation you get by passing DBUS_NAME_FLAG_DO_NOT_QUEUE when
>>>       acquiring the name)
>>>
>>>       c) the name will be taken away forcible from the old owner (only
>>>       if the new owner indicated DBUS_NAME_FLAG_REPLACE_EXISTING, and
>>>       the old one DBUS_NAME_FLAG_ALLOW_REPLACEMENT).
>>>
>>> Either way, and no times there are two owners of a name at the same
>>> time, neither in kdbus, nor in dbus-daemon.
>>>
>>> Lennart
>>>
>>
>> I'm asking specifically because current dbus-daemon seems to
>> kinda handle it, but kdbus will error out when it tries to
>> create a symlink for bus-proxyd. I was asked on systemd
>> bug tracker how dbus handles this, that's why I asked here.
> 
> What you are referring to is having files in
> /usr/share/dbus-1/{system}-services/
> which provide the same "Name".
> It's not enforced, that the Name in the .service file is named after
> the D-Bus name.
> 
> So you can have
>  foo.service with Name=org.fdo.baz
> and
>  bar.service with Name=org.fdo.baz
> 
> I think your question is, assuming that neither foo or bar is running,
> and there is an incoming request for org.fdo.baz, which one of the two
> is started?
> 

Yes, that was the question.

The answer to that is probably a solution to this:

https://github.com/systemd/systemd/issues/312

-- 
Note: My last name is not Krejzi.

_______________________________________________
dbus mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dbus
signature.asc (application/pgp-signature, 819 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQIcBAEBCAAGBQJVhy3uAAoJEMxyaRAVyqJOq04P/iP060nP8p2BkVSMBgp1JREl
d392IThfT+ot37B1B5UOx5VD8VeaEFdsWLQYpZvjyTSw1FebzbQcCgvQ2ITyak+E
Esuc1MZZNi/AfBSKMf7rLNdI7wBSWbkgSmgMc1/slPaHTHWw8JJMBbgGtOp747k4
JczSJv3otzrDNVlH/Whur7xzVc5wXLa0guk0ijg9ODHPLvu8up8y3vhBgerpv6r3
JEkujTxwIQMmZmGnDZ8UQFKVPlOfZdptR3KEm7B4chuYuJxd0jxZLcr3NmKV18FZ
J/8QgeE8FqHhkLAZ1fHDS8ZyEHRiVpXTnD7pfePGNe3JLWdH2vRxclpS80ganRRW
dZAvhhkpQNci152cr/RdZcg4e1zbWSce7527oUR9lYzEUnNzMya7e9xTzS2ORjSj
f1MO9nRVa86eF1Wb6Bh+attO1zJQa6ofmsCwFrtHqwVuwvL1klgNYaRs+bMuFwon
IXZ849JnzE7K9UTfWtEF5KaxQHns/YvfRVvX1BAWm4fQbirevLlkTry9GRyfZw1i
kfUTqqidTbnyO6Gw7Dq4LEPVD15PmJgkMj+Qf2Ok5HGw16FT2EuigwXS8s/wtF61
FwL44r4zuJF7BsLZSy6yJfFVnLVsucerHwgqybMcksSsD6Ot+uCiNMLkPTyS6/tt
i0jWkXRw9nzuj/rn2bfm
=Aj4/
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.