From: Mike Yuan Date: Sun, 19 Oct 2025 19:35:52 +0000 (+0200) Subject: core/service: forbid reverting STOPPING=1 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=98734ac74d16862302c490e2a5bbc60539b7e6a4;p=thirdparty%2Fsystemd.git core/service: forbid reverting STOPPING=1 We don't permit state transition from STOPPING back to RUNNING, hence refrain from resetting notify_state too. --- diff --git a/src/core/service.c b/src/core/service.c index 3722cc5e663..bfd6022e0e9 100644 --- a/src/core/service.c +++ b/src/core/service.c @@ -4769,7 +4769,14 @@ static void service_notify_message_process_state(Service *s, char * const *tags) if (IN_SET(s->state, SERVICE_RUNNING, SERVICE_RELOAD_SIGNAL, SERVICE_RELOAD_NOTIFY, SERVICE_REFRESH_EXTENSIONS)) service_enter_stop_by_notify(s); - } else if (strv_contains(tags, "READY=1")) { + return; + } + + /* Disallow resurrecting a dying service */ + if (s->notify_state == NOTIFY_STOPPING) + return; + + if (strv_contains(tags, "READY=1")) { s->notify_state = NOTIFY_READY;