]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
core/service: also allow updating main pid when SERVICE_STOP
authorMike Yuan <me@yhndnzj.com>
Tue, 23 Apr 2024 10:37:26 +0000 (18:37 +0800)
committerMike Yuan <me@yhndnzj.com>
Tue, 23 Apr 2024 12:01:01 +0000 (20:01 +0800)
Follow-up for f5b72af50d2bb6879f0e6d8ea10f34e9c111dcd1

See also: https://github.com/systemd/systemd/pull/32120#discussion_r1575992623

src/core/service.c

index 2b4e1b5c690a451d27ee4bd0a3358d510c4888af..4df14b6918510fac796f326e1d7403b1de3c7f68 100644 (file)
@@ -4385,7 +4385,10 @@ 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_STOP_SIGTERM, SERVICE_RELOAD, SERVICE_RELOAD_SIGNAL, SERVICE_RELOAD_NOTIFY)) {
+        if (e && IN_SET(s->state, SERVICE_START, SERVICE_START_POST, SERVICE_RUNNING,
+                        SERVICE_RELOAD, SERVICE_RELOAD_SIGNAL, SERVICE_RELOAD_NOTIFY,
+                        SERVICE_STOP, SERVICE_STOP_SIGTERM)) {
+
                 _cleanup_(pidref_done) PidRef new_main_pid = PIDREF_NULL;
 
                 r = pidref_set_pidstr(&new_main_pid, e);