daandemeyer / rpms / systemd

Forked from rpms/systemd 2 years ago
Clone
3e5297
From 0a2e691b6b1fdceb4b7504870c4b792a66b5080f Mon Sep 17 00:00:00 2001
3e5297
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
3e5297
Date: Thu, 22 Jul 2021 11:28:36 +0200
3e5297
Subject: [PATCH 3/5] rpm: call +needs-restart in parallel
3e5297
MIME-Version: 1.0
3e5297
Content-Type: text/plain; charset=UTF-8
3e5297
Content-Transfer-Encoding: 8bit
3e5297
3e5297
Some rpms install a bunch of units… It seems nicer to invoke them all in
3e5297
parallel. In particular, timeouts in systemctl also run in parallel, so if
3e5297
there's some communication mishap, we will wait less.
3e5297
3e5297
(cherry picked from commit 3598aff4d963b2e51ac74d206161da47bfde785c)
3e5297
---
3e5297
 src/rpm/systemd-update-helper.in | 3 ++-
3e5297
 1 file changed, 2 insertions(+), 1 deletion(-)
3e5297
3e5297
diff --git a/src/rpm/systemd-update-helper.in b/src/rpm/systemd-update-helper.in
3e5297
index 9fa49fa131..f3c75b75fa 100755
3e5297
--- a/src/rpm/systemd-update-helper.in
3e5297
+++ b/src/rpm/systemd-update-helper.in
3e5297
@@ -32,8 +32,9 @@ case "$command" in
3e5297
         [ -d /run/systemd/system ] || exit 0
3e5297
 
3e5297
         for unit in "$@"; do
3e5297
-            systemctl set-property "$unit" Markers=+needs-restart || :
3e5297
+            systemctl set-property "$unit" Markers=+needs-restart &
3e5297
         done
3e5297
+        wait
3e5297
         ;;
3e5297
 
3e5297
     system-reload-restart|system-reload|system-restart)
3e5297
-- 
3e5297
2.31.1
3e5297