<html><body><div style="color:#000; background-color:#fff; font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:12pt"><div><span>Thanks Lennart. Just a follow up question, can we get the "result" from the Agent Released message on the dbus somehow? Or which message should I be listening on dbus for this?</span></div><div class="yahoo_quoted" style="display: block;"> <br> <br> <div style="font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12pt;"> <div style="font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12pt;"> <div dir="ltr"> <font size="2" face="Arial"> On Thursday, February 27, 2014 5:14 PM, Lennart Poettering <lennart@poettering.net> wrote:<br> </font> </div> <div class="y_msg_container">On Wed, 26.02.14 11:59, Usman (<a shape="rect" ymailto="mailto:desert03@yahoo.com"
href="mailto:desert03@yahoo.com">desert03@yahoo.com</a>) wrote:<div class="yqt8361273338" id="yqtfd63452"><br clear="none"><br clear="none">> Hi Guys,<br clear="none">> <br clear="none">> <br clear="none">> <br clear="none">> I am getting started with systemd and am looking for a particular<br clear="none">> answer. I know the config option "StartLimitAction=" will have a<br clear="none">> pre-set option to choose from. It either restarts the box or so. But I<br clear="none">> want to do something else as well. For example I want to execute a<br clear="none">> script when rate limit configured and burst level is hit. Is there a<br clear="none">> way to do that? Specifically I am looking for any message/event that I<br clear="none">> can see on dbus etc to know that tha restart rate limit is hit and<br clear="none">> we're restarting the box or just plainly stopping application (no more<br clear="none">>
restarts). Any way to do that?</div><br clear="none"><br clear="none">You can invoke another service with OnFailure= as soon as your service<br clear="none">fails. Then, you can pull the failure reason out of the original service<br clear="none">via the bus and act on it.<br clear="none"><br clear="none">OnFailure=failure-handler@%p.servince<br clear="none"><br clear="none">and then in <a shape="rect" ymailto="mailto:failure-handler@.service" href="mailto:failure-handler@.service">failure-handler@.service</a> you take %i and use your own bus<br clear="none">client or "systemctl show -p" to query the "Result" property which will<br clear="none">tell you the reason the unit failed.<br clear="none"><br clear="none">Lennart<br clear="none"><br clear="none">-- <br clear="none">Lennart Poettering, Red Hat<div class="yqt8361273338" id="yqtfd09394"><br clear="none"></div><br><br></div> </div> </div> </div> </div></body></html>