[prev in list] [next in list] [prev in thread] [next in thread] 

List:       freedesktop-dbus
Subject:    Re: Detect new available names in bus
From:       "Thomas Kluyver" <thomas () kluyver ! me ! uk>
Date:       2022-02-15 13:36:17
Message-ID: bc582667-464b-48e2-95b9-cb7010fc61bc () www ! fastmail ! com
[Download RAW message or body]

From my reading of the spec it makes sense that NameOwnerChanged is only triggered \
when an application actually runs, connects to D-Bus and claims the name. 'Owner' \
seems to refer to a D-Bus connection (see e.g. the description of GetNameOwner). So \
registering a name for activation is not sufficient to 'own' it. On my system, \
NameHasOwner is True only for names with an active connection, though this is \
different from what Sergio said in his original message.

I think it's a reasonable suggestion that there should be a signal when the set of \
activatable names changes. To be clear, though, I have no power in changing the D-Bus \
spec.

My only concern is that this would require a particular kind of implementation. At \
present, the bus *could* opt to search through the files for activatable names only \
when it gets a request with a name not already claimed (or when ListActivatableNames \
is called). Specifying that it must send a signal means it has to constantly monitor \
those files (either with something like inotify, or regular polling). But if the \
reference implementation is already doing that, maybe this isn't important.

Best wishes,
Thomas

On Tue, 15 Feb 2022, at 13:13, Sergio Costas wrote:
> Hi:
> 
> El 15/2/22 a las 13:58, Ralf Habacker escribió:
> > Am 15.02.22 um 11:35 schrieb Sergio Costas:
> > > Which confirms that the dbus daemon is already monitoring those 
> > > folders (both with inotify for linux and kqueue for BSD), so adding 
> > > that dbus signal sould be quite straightforward...
> > > 
> > > So... How much complex is to submit a proposal for modifying the 
> > > specification...?
> > > 
> > 
> > Have you checked 
> > https://dbus.freedesktop.org/doc/dbus-specification.html to see if 
> > there is already a signal that meets your requirements?
> > 
> > A quick look shows me that these may be usable here:
> > 
> > org.freedesktop.DBus.NameOwnerChanged - This signal indicates that the 
> > owner of a name has changed. It's also the signal to use to detect the 
> > appearance of new names on the bus.
> > 
> > org.freedesktop.DBus.NameLost - This signal is sent to a specific 
> > application when it loses ownership of a name.
> > 
> > org.freedesktop.DBus.NameAcquired - This signal is sent to a specific 
> > application when it gains ownership of a name. 
> 
> As I commented in a previous message, I already checked all those. 
> NameLost and NameAcquired seems to be emitted only to the current owner 
> of the name, to notify that it has successfully acquired a name or if 
> some other service "stole" it. I connected to them but don't receive any 
> signal, no matter that I install or uninstall the files, launch or kill 
> de daemon...
> 
> About NameOwnerChanged, it only notifies when a daemon actually acquires 
> a name, but that requires it to be launched. This means that an 
> activatable service won't emit that unless any of their methods is 
> called, thus loading the daemon. Again, that's not what I need. What I 
> need is to detect when the .service file is added or removed.
> 
> -- 
> 
> Nos leemos
> 		         RASTER    (Linux user #228804)
> rastersoft@gmail.com                https://www.rastersoft.com


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic