Re: [systemd-devel] How to get notified on service state change

2015-10-11 Thread Pradeepa Kumar
2nd try..


On Fri, Oct 9, 2015 at 6:52 AM, Pradeepa Kumar  wrote:

> Hi systemd-experts,
>
> I am writing a daemon which starts, stops and monitor services and I am
> using dbus to interface with systemd. I send messages on dbus to start or
> stop the service and this is working well. I want to achieve the following:
>
>
>
> 1) Monitor service exit using the systemd dbus interface.
>
> 2) Monitor when the service has entered a failed state
>
>
>
> I am trying to understand what is the right mechanism to implement this
> using the systemd dbus interface, I have tried a few things clearly I don’t
> understand how this works, any help greatly appreciated.
>
>
>
> I am looking for way to know when service stopped or failed so that i can
> take some action in my monitoring app.
>
> I am listening to PropertiesChanged signal and query ActiveState property
> to get new value. This does not work always.
> Some times, unit is unloaded before I query the ActiveState.
> 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 best way to achieve my requirement ?
>
> Appreciate your help on above queries
>
>
>
> Thanks
>
> Prashant
>
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


[systemd-devel] How to get notified on service state change

2015-10-08 Thread Pradeepa Kumar
Hi systemd-experts,

I am writing a daemon which starts, stops and monitor services and I am
using dbus to interface with systemd. I send messages on dbus to start or
stop the service and this is working well. I want to achieve the following:



1) Monitor service exit using the systemd dbus interface.

2) Monitor when the service has entered a failed state



I am trying to understand what is the right mechanism to implement this
using the systemd dbus interface, I have tried a few things clearly I don’t
understand how this works, any help greatly appreciated.



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

I am listening to PropertiesChanged signal and query ActiveState property
to get new value. This does not work always.
Some times, unit is unloaded before I query the ActiveState.
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 best way to achieve my requirement ?

Appreciate your help on above queries



Thanks

Prashant
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel