[systemd-devel] DBus signal on unit start/stop

Lennart Poettering lennart at poettering.net
Tue Dec 3 11:01:29 PST 2013


On Tue, 03.12.13 17:26, Ragnar Thomsen (rthomsen6 at gmail.com) wrote:

> 
> On Saturday 30 November 2013 19:30:12 you wrote:
> > There are standard dbus PropertiesChanged signals sent out for ActiveState
> > changes, which invalidate the properties when they change in released
> > versions of systemd, and which carry the new values along in git.
> > 
> > We probably should document which ones we generate this for in
> > 
> > http://www.freedesktop.org/wiki/Software/systemd/dbus/
> > 
> > Lennart
> 
> Thanks for your reply. I have now been playing around with the 
> PropertiesChanged signal and found it quite useful for getting updates from 
> systemd. By hooking it up with a Qt slot I can update the UI on any unit 
> changes. The only drawback is that I am not able to get information about 
> which unit had its properties changed from the signal, so I have to update the 
> entire list of units. However, this is much better than querying for unit 
> changes at certain time intervals.

Hmm? In D-Bus signals are sent out by an object which is identified by
its object path. In this case we sent out the PropertiesChanged signals
from the unit objects, sind those are the ones that change... 

ListUnits() will include the object paths of all unit it lists and
PopertiesChanged is sent from the same objects paths, so you have got
everything you need...

> Another issue I noticed is that enabling/disabling a unit's files through the 
> dbus methods (EnableUnitFiles/DisableUnitFiles) does not update the 
> UnitFileState property for the unit.
>
> When enabling/disabling units using the systemctl tool, the systemd daemon 
> gets reloaded so the property gets updated.
> Is this the intended behavior?

Yes, we do not reload status on disk, unless the whole daemon is
reloaded. 

Lennart

-- 
Lennart Poettering, Red Hat


More information about the systemd-devel mailing list