[systemd-devel] Effect of reset-failed on service that is not in failed state

Lennart Poettering lennart at poettering.net
Wed Mar 6 09:25:59 UTC 2019


On Mi, 06.03.19 11:15, prashantkumar dhotre (prashantkumardhotre at gmail.com) wrote:

> Hi,
> Is there any side-effect of the 'reset-failed' operation on a service that
> is not in failed state.
> My understanding is , in that case, it is no-op.

It mostly is. But note that it will reset a few more things than just
the failed state: it also resets start limit counters and such,
i.e. resets the counters StartLimitIntervalSec=/StartLimitBurst=
maintain. Thus, if you cll "systemctl reset-failed" all the time you
basically undo the safety effect the start limit counter stuff is
supposed to provide.

> I have an app which uses dbus API for systemd to start/stop services.
> Here I always the startApp() of my app should always result in starting of
> app, even if it is inn failed/stopped state.
> Is it safe to always call 'reset-failed' systemd dbus API before I call
> 'start' dbus API, in my startApp() ?

systemd does that implicitly anyway: when you start a service that is
currently in failed state the failed state is reset. (The start limit
counter is however not reset, obviously not, so it's similar to
an implicit reset-failed, but also not.)

Lennart

--
Lennart Poettering, Red Hat


More information about the systemd-devel mailing list