ryantimwilson / rpms / systemd

Forked from rpms/systemd a month ago
Clone
Blob Blame History Raw
From 3598aff4d963b2e51ac74d206161da47bfde785c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
Date: Thu, 22 Jul 2021 11:28:36 +0200
Subject: [PATCH] rpm: call +needs-restart in parallel
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Some rpms install a bunch of units… It seems nicer to invoke them all in
parallel. In particular, timeouts in systemctl also run in parallel, so if
there's some communication mishap, we will wait less.
---
 src/rpm/systemd-update-helper.in | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/rpm/systemd-update-helper.in b/src/rpm/systemd-update-helper.in
index 9fa49fa131..f3c75b75fa 100755
--- a/src/rpm/systemd-update-helper.in
+++ b/src/rpm/systemd-update-helper.in
@@ -32,8 +32,9 @@ case "$command" in
         [ -d /run/systemd/system ] || exit 0
 
         for unit in "$@"; do
-            systemctl set-property "$unit" Markers=+needs-restart || :
+            systemctl set-property "$unit" Markers=+needs-restart &
         done
+        wait
         ;;
 
     system-reload-restart|system-reload|system-restart)