Re: From dbus notification, how to know service entered failed state and will not start without admin action

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,
Can you please help ?
I see that in OnFailure behaviour is changed and these units in OnFailure gets triggerd when service is failed-and-will-not-restart-automatically.
https://lists.freedesktop.org/archives/systemd-devel/2018-June/040879.html
In such case, does systemd also send dbus signal  whenever it triggers OnFailure ?
Thanks


On Fri, Feb 18, 2022 at 8:55 PM Prashantkumar dhotre <cdprashanth@xxxxxxxxx> wrote:
Hi,
In my app, I am monitoring a few services and would like to do some cleanup in my app, when these services  fail in such a way that they don't restart back up without admin action.
From  dbus-monitor , I see that 'Result' dbus PropertiesChanged signal comes first and then 'ActiveState' PropertiesChanged signal comes next.
I was hoping that to use   'ActiveState' = "failed"  and "SubState" = "failed" but that does not satisfy my requirement as 
when I  send sigkill  i get "ActiveState" and "SubState" as "failed" in DBus notification but service starts back up automatically (due to 'Restart' &  'ActiveState'settings )
Also when app exits with non-zero code also , I get "ActiveState" and "SubState" as "failed" in DBus notification.
So I can not use only  "ActiveState" and "SubState" values , as app restarts after these states report "failed" (in which case my app should not do cleanup)
Using dbus notification, how can determine that service is down and not going to start automatically so that in my app i can do cleanup ?
Is there any parameter in PropertiesChanged  signal that tells that app is down and will not start back up automatically ?
I am using systemd 243.
Thanks for your help.
Regards




[Index of Archives]     [LARTC]     [Bugtraq]     [Yosemite Forum]     [Photo]

  Powered by Linux