systemd/backport-scope-do-not-disable-timer-event-source-when-state-i.patch
wangyuhang a4f95d3244 sync patch from systemd community
(cherry picked from commit 88369f234ec01b60fb047caf87b90ef10a92b0db)
2023-10-10 10:04:24 +08:00

42 lines
1.6 KiB
Diff

From 7aa7e9e93db471b1811a916a3c3c6e3d53abad4a Mon Sep 17 00:00:00 2001
From: Nick Rosbrook <nick.rosbrook@canonical.com>
Date: Tue, 4 Apr 2023 18:39:26 -0400
Subject: [PATCH] scope: do not disable timer event source when state is
SCOPE_RUNNING
In scope_set_state(), the timer event source may be disabled depending
on the state. Currently, it will be disabled when the state is
SCOPE_RUNNING. This has the effect of new RuntimeMaxSec values being
ignored on coldplug.
Note that this issue is not currently present when scopes are started
because when scope_start() is called, scope_arm_timer() is called after
scope_set_state().
(cherry picked from commit e1f85b49b09ed3e3717cf7776c9da7acc4e906c6)
(cherry picked from commit 999f48558bbe5d4665b97d76c530edc12f71b70b)
(cherry picked from commit 6bdcd58a88ca70b4fc097941a8f435400eb90e53)
Conflict:NA
Reference:https://github.com/systemd/systemd-stable/commit/7aa7e9e93db471b1811a916a3c3c6e3d53abad4a
---
src/core/scope.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/core/scope.c b/src/core/scope.c
index 1289bb8cb4..a2c9a3fd4d 100644
--- a/src/core/scope.c
+++ b/src/core/scope.c
@@ -107,7 +107,7 @@ static void scope_set_state(Scope *s, ScopeState state) {
old_state = s->state;
s->state = state;
- if (!IN_SET(state, SCOPE_STOP_SIGTERM, SCOPE_STOP_SIGKILL))
+ if (!IN_SET(state, SCOPE_STOP_SIGTERM, SCOPE_STOP_SIGKILL, SCOPE_RUNNING))
s->timer_event_source = sd_event_source_disable_unref(s->timer_event_source);
if (IN_SET(state, SCOPE_DEAD, SCOPE_FAILED)) {
--
2.33.0