From f5b72af50d2bb6879f0e6d8ea10f34e9c111dcd1 Mon Sep 17 00:00:00 2001 From: Michal Sekletar Date: Fri, 5 Apr 2024 17:34:23 +0200 Subject: [PATCH] service: allow MainPID= updates during stop of the service Example use case is a migration of MainPID to an auxiliary scope. --- src/core/service.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/service.c b/src/core/service.c index 366f52f3e0..2b4e1b5c69 100644 --- a/src/core/service.c +++ b/src/core/service.c @@ -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); -- 2.25.1