mirror of
https://github.com/systemd/systemd.git
synced 2025-02-28 05:57:33 +03:00
service: flush the start counter in "systemctl reset-failed"
This commit is contained in:
parent
6ffd333786
commit
451b34cc1d
@ -768,7 +768,15 @@
|
||||
however they may still be restarted
|
||||
manually at a later point from which
|
||||
point on the restart logic is again
|
||||
activated.</para></listitem>
|
||||
activated. Note that
|
||||
<command>systemctl
|
||||
reset-failed</command> will cause the
|
||||
restart rate counter for a service to
|
||||
be flushed, which is useful if the
|
||||
administrator wants to manually start
|
||||
a service and the start limit
|
||||
interferes with
|
||||
that.</para></listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
|
@ -3655,6 +3655,8 @@ static void service_reset_failed(Unit *u) {
|
||||
|
||||
s->result = SERVICE_SUCCESS;
|
||||
s->reload_result = SERVICE_SUCCESS;
|
||||
|
||||
RATELIMIT_RESET(s->start_limit);
|
||||
}
|
||||
|
||||
static int service_kill(Unit *u, KillWho who, KillMode mode, int signo, DBusError *error) {
|
||||
|
@ -48,6 +48,13 @@ typedef struct RateLimit {
|
||||
_r->begin = 0; \
|
||||
} while (false)
|
||||
|
||||
#define RATELIMIT_RESET(v) \
|
||||
do { \
|
||||
RateLimit *_r = &(v); \
|
||||
_r->num = 0; \
|
||||
_r->begin = 0; \
|
||||
} while (false)
|
||||
|
||||
bool ratelimit_test(RateLimit *r);
|
||||
|
||||
#endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user