121229
From 81b59fbbd6ebeee05b5d6869ae4f36bb9e486f72 Mon Sep 17 00:00:00 2001
121229
From: Lukas Nykryn <lnykryn@redhat.com>
121229
Date: Tue, 8 Jan 2019 17:16:07 +0100
121229
Subject: [PATCH] 95iscsi: rd.iscsi.initiator should have priority over stored
121229
 configuration
121229
121229
(cherry picked from commit 61afc704548cecc7f7d2fa3b5f1319e790cc5bee)
121229
121229
Resolves: #1664062
121229
---
121229
 modules.d/95iscsi/parse-iscsiroot.sh | 15 +++++++--------
121229
 1 file changed, 7 insertions(+), 8 deletions(-)
121229
121229
diff --git a/modules.d/95iscsi/parse-iscsiroot.sh b/modules.d/95iscsi/parse-iscsiroot.sh
121229
index 7a64d888..f00a83bb 100755
121229
--- a/modules.d/95iscsi/parse-iscsiroot.sh
121229
+++ b/modules.d/95iscsi/parse-iscsiroot.sh
121229
@@ -107,14 +107,13 @@ if arg=$(getarg rd.iscsi.initiator -d iscsi_initiator=) && [ -n "$arg" ] && ! [
121229
     iscsi_initiator=$arg
121229
     echo "InitiatorName=$iscsi_initiator" > /run/initiatorname.iscsi
121229
     ln -fs /run/initiatorname.iscsi /dev/.initiatorname.iscsi
121229
-    if ! [ -e /etc/iscsi/initiatorname.iscsi ]; then
121229
-        mkdir -p /etc/iscsi
121229
-        ln -fs /run/initiatorname.iscsi /etc/iscsi/initiatorname.iscsi
121229
-        if [ -n "$DRACUT_SYSTEMD" ]; then
121229
-            systemctl try-restart iscsid
121229
-            # FIXME: iscsid is not yet ready, when the service is :-/
121229
-            sleep 1
121229
-        fi
121229
+    rm -f /etc/iscsi/initiatorname.iscsi
121229
+    mkdir -p /etc/iscsi
121229
+    ln -fs /run/initiatorname.iscsi /etc/iscsi/initiatorname.iscsi
121229
+    if [ -n "$DRACUT_SYSTEMD" ]; then
121229
+        systemctl try-restart iscsid
121229
+        # FIXME: iscsid is not yet ready, when the service is :-/
121229
+        sleep 1
121229
     fi
121229
 fi
121229
 
121229