core/service: forbid reverting STOPPING=1

We don't permit state transition from STOPPING back to RUNNING,
hence refrain from resetting notify_state too.
This commit is contained in:
Mike Yuan
2025-11-04 12:17:32 +01:00
parent ed834f11cb
commit 98734ac74d
+8 -1
View File
@@ -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;