Blame SOURCES/0560-95iscsi-iscsiroot-synchronously-wait-until-iscsistar.patch

49e6a8
From 937b808a0d71b68a3285cf3e9d162b0060c5bcdf Mon Sep 17 00:00:00 2001
49e6a8
From: Lukas Nykryn <lnykryn@redhat.com>
49e6a8
Date: Mon, 1 Apr 2019 17:25:01 +0200
49e6a8
Subject: [PATCH] 95iscsi/iscsiroot: synchronously wait until iscsistart
49e6a8
 finishes
49e6a8
49e6a8
---
49e6a8
 modules.d/95iscsi/iscsiroot.sh | 5 +++++
49e6a8
 1 file changed, 5 insertions(+)
49e6a8
49e6a8
diff --git a/modules.d/95iscsi/iscsiroot.sh b/modules.d/95iscsi/iscsiroot.sh
49e6a8
index c93ff068..e94f596b 100755
49e6a8
--- a/modules.d/95iscsi/iscsiroot.sh
49e6a8
+++ b/modules.d/95iscsi/iscsiroot.sh
49e6a8
@@ -197,6 +197,11 @@ handle_netroot()
49e6a8
 	                    ${iscsi_netdev_name:+--param "iface.net_ifacename=$iscsi_netdev_name"} \
49e6a8
                             ${iscsi_param} >/dev/null 2>&1 \
49e6a8
 	            && { > $hookdir/initqueue/work ; }
49e6a8
+                while : ; do
49e6a8
+                    status=$(systemctl is-active "$netroot_enc" 2>/dev/null)
49e6a8
+                    [ "$status" != "activating" ] && break
49e6a8
+                    sleep 1
49e6a8
+                done
49e6a8
             else
49e6a8
                 systemctl --no-block restart "$netroot_enc" >/dev/null 2>&1 \
49e6a8
 	            && { > $hookdir/initqueue/work ; }