]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
service: allow MainPID= updates during stop of the service
authorMichal Sekletar <msekleta@redhat.com>
Fri, 5 Apr 2024 15:34:23 +0000 (17:34 +0200)
committerLennart Poettering <lennart@poettering.net>
Tue, 23 Apr 2024 09:41:10 +0000 (11:41 +0200)
Example use case is a migration of MainPID to an auxiliary scope.

src/core/service.c

index 366f52f3e0c5af4e3c9b22f552a06e6bba562924..2b4e1b5c690a451d27ee4bd0a3358d510c4888af 100644 (file)
@@ -4385,7 +4385,7 @@ static void service_notify_message(
 
         /* Interpret MAINPID= */
         e = strv_find_startswith(tags, "MAINPID=");
-        if (e && IN_SET(s->state, SERVICE_START, SERVICE_START_POST, SERVICE_RUNNING, SERVICE_RELOAD, SERVICE_RELOAD_SIGNAL, SERVICE_RELOAD_NOTIFY)) {
+        if (e && IN_SET(s->state, SERVICE_START, SERVICE_START_POST, SERVICE_RUNNING, SERVICE_STOP_SIGTERM, SERVICE_RELOAD, SERVICE_RELOAD_SIGNAL, SERVICE_RELOAD_NOTIFY)) {
                 _cleanup_(pidref_done) PidRef new_main_pid = PIDREF_NULL;
 
                 r = pidref_set_pidstr(&new_main_pid, e);