core: set Result=start-limit-hit when a unit is rate limited

There is currently no way to figure out a rate limit was hit on a unit,
as the last result is stripped in order to keep reporting the first
result, which is useful in case of a watchdog failure, which is the
reason why it was changed as such.

But rate limiting is also an important information to provide to
users, so allow the Result property to reflect it when it
happens.
This commit is contained in:
Luca Boccassi
2025-12-18 00:19:09 +01:00
committed by Mike Yuan
parent 2a1193d4cc
commit 90f4c0473a
8 changed files with 8 additions and 7 deletions
+1 -1
View File
@@ -324,7 +324,7 @@ static int timer_coldplug(Unit *u) {
static void timer_enter_dead(Timer *t, TimerResult f) {
assert(t);
if (t->result == TIMER_SUCCESS)
if (t->result == TIMER_SUCCESS || f == TIMER_FAILURE_START_LIMIT_HIT)
t->result = f;
unit_log_result(UNIT(t), t->result == TIMER_SUCCESS, timer_result_to_string(t->result));