[systemd-devel] changed property value in signal

Pradeepa Kumar cdpradeepa at gmail.com
Thu Oct 8 18:13:23 PDT 2015


Thanks for reply.

I am writing a monitoring application to start, stop and monitor service
state.

I am looking for way to know when service stoppped or failed so that i can
take some action in my monitoring app.

I am listening to PropertiesChanged signal and query ActiveState. This does
not work always.
Some times, unit is unloaded before I query the ActiveState. What is the
solution for this

Do we get new values of property along with PropertiesChanged signal in new
version of systemd?
if yes in which version this feature was added ?

What is the solution to achieve my requirement ?



On Fri, Jul 3, 2015 at 3:35 PM, Lennart Poettering <lennart at poettering.net>
wrote:

> On Fri, 03.07.15 15:12, Pradeepa Kumar (cdpradeepa at gmail.com) wrote:
>
> > On Fri, Jul 3, 2015 at 2:12 PM, Lennart Poettering <
> lennart at poettering.net>
> > wrote:
> >
> > > On Thu, 02.07.15 10:18, Pradeepa Kumar (cdpradeepa at gmail.com) wrote:
> > >
> > > > hi
> > > > I am new to systemd.
> > > > I am using systemd 208, libdbus-1-3_1.4.18-1ubuntu1.4_i386.deb
> > > > I am to monitor unit stop/failure in my application .
> > > > So I am subscribing to propertiesChanged signal and paring SubState.
> > > > The propertieschanged message contains a dictionary and invalidated
> list
> > > > of properties.
> > > > But the dictionary is empty(which is supposed to contain new value of
> > > > changed properties), so i am left with querying new values of the
> changed
> > > > property from list of invalidated properties list.
> > > >
> > > > - please let me know how do i get new values in the signal msg
> > > >   itself
> > >
> > > you don't. We just invalidate the props, you have to query them
> > > aftwards yourself, to determine the n value.
> >
> >  Prad>>  But in online, i see some example of dbus-monitor command where
> > output has a dictionary- which contains properties and new values.
> > I want same output. how do i get that??
>
> You don't... It's up to the service to decide which properties it
> just invalidates and which ones it sends along.
>
> > > We take the liberty to invalidate some props and send the full value
> > > of others along. it's not considered api really which prop gets which
> > > behaviour...
> >
> > Prad>> I did not understand this comment
> > Can you please explain
>
> It's up to the service (in this case systemd) to choose which props it
> sends PropertiesChanged signals for, and if it decides to do so,
> for which it sends invalidation and for which it sends the full value
> along.
>
> Lennart
>
> --
> Lennart Poettering, Red Hat
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/systemd-devel/attachments/20151009/8c38e6b2/attachment.html>


More information about the systemd-devel mailing list