daandemeyer / rpms / systemd

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