daandemeyer / rpms / systemd

Forked from rpms/systemd 2 years ago
Clone
36d2f4
From 37f2576684d7494c916fd1f13275982f3c43f44f Mon Sep 17 00:00:00 2001
36d2f4
From: Lennart Poettering <lennart@poettering.net>
36d2f4
Date: Wed, 22 Apr 2020 20:34:02 +0200
36d2f4
Subject: [PATCH] core: make sure to restore the control command id, too
36d2f4
36d2f4
Fixes: #15356
36d2f4
(cherry picked from commit e9da62b18af647bfa73807e1c7fc3bfa4bb4b2ac)
36d2f4
36d2f4
Resolves: #1829867
36d2f4
---
36d2f4
 src/core/service.c | 5 +++--
36d2f4
 1 file changed, 3 insertions(+), 2 deletions(-)
36d2f4
36d2f4
diff --git a/src/core/service.c b/src/core/service.c
36d2f4
index 89b41f6783..7cff419e4e 100644
36d2f4
--- a/src/core/service.c
36d2f4
+++ b/src/core/service.c
36d2f4
@@ -2703,9 +2703,10 @@ static int service_deserialize_exec_command(Unit *u, const char *key, const char
36d2f4
                                 break;
36d2f4
         }
36d2f4
 
36d2f4
-        if (command && control)
36d2f4
+        if (command && control) {
36d2f4
                 s->control_command = command;
36d2f4
-        else if (command)
36d2f4
+                s->control_command_id = id;
36d2f4
+        } else if (command)
36d2f4
                 s->main_command = command;
36d2f4
         else
36d2f4
                 log_unit_warning(u, "Current command vanished from the unit file, execution of the command list won't be resumed.");