]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
scope: do not disable timer event source when state is SCOPE_RUNNING
authorNick Rosbrook <nick.rosbrook@canonical.com>
Tue, 4 Apr 2023 22:39:26 +0000 (18:39 -0400)
committerNick Rosbrook <nick.rosbrook@canonical.com>
Thu, 13 Apr 2023 18:34:41 +0000 (14:34 -0400)
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().

src/core/scope.c

index 510bb28c9375f875bbd3456bd8a07caede6ca73a..5f3b62e02194f62da80f4d8986bc60bf4de26407 100644 (file)
@@ -116,7 +116,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, SCOPE_START_CHOWN))
+        if (!IN_SET(state, SCOPE_STOP_SIGTERM, SCOPE_STOP_SIGKILL, SCOPE_START_CHOWN, SCOPE_RUNNING))
                 s->timer_event_source = sd_event_source_disable_unref(s->timer_event_source);
 
         if (IN_SET(state, SCOPE_DEAD, SCOPE_FAILED)) {