1
0
mirror of https://github.com/systemd/systemd.git synced 2025-01-06 17:18:12 +03:00

core/service: also allow updating main pid when SERVICE_STOP

Follow-up for f5b72af50d

See also: https://github.com/systemd/systemd/pull/32120#discussion_r1575992623
This commit is contained in:
Mike Yuan 2024-04-23 18:37:26 +08:00
parent 1b47cfab7f
commit 31197c684a
No known key found for this signature in database
GPG Key ID: 417471C0A40F58B3

View 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);