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