Blame SOURCES/0323-iscsi-parse-iscsiroot.sh-restart-iscsid-with-try-res.patch

712866
From a6befb52eb5eeb87c0c41303fe08e50bd2fde0d3 Mon Sep 17 00:00:00 2001
712866
From: Harald Hoyer <harald@redhat.com>
712866
Date: Tue, 25 Aug 2015 11:16:46 +0200
712866
Subject: [PATCH] iscsi/parse-iscsiroot.sh: restart iscsid with try-restart
712866
712866
---
712866
 modules.d/95iscsi/parse-iscsiroot.sh | 7 ++-----
712866
 1 file changed, 2 insertions(+), 5 deletions(-)
712866
712866
diff --git a/modules.d/95iscsi/parse-iscsiroot.sh b/modules.d/95iscsi/parse-iscsiroot.sh
5c6c2a
index 13a95023..6dd929f3 100755
712866
--- a/modules.d/95iscsi/parse-iscsiroot.sh
712866
+++ b/modules.d/95iscsi/parse-iscsiroot.sh
712866
@@ -105,7 +105,7 @@ if [ -n "$netroot" ] && [ "$root" != "/dev/root" ] && [ "$root" != "dhcp" ]; the
712866
     fi
712866
 fi
712866
 
712866
-if arg=$(getarg rd.iscsi.initiator -d iscsi_initiator=) && [ -n "$arg" ]; then
712866
+if arg=$(getarg rd.iscsi.initiator -d iscsi_initiator=) && [ -n "$arg" ] && ! [ -f /run/initiatorname.iscsi ] ; then
712866
     iscsi_initiator=$arg
712866
     echo "InitiatorName=$iscsi_initiator" > /run/initiatorname.iscsi
712866
     ln -fs /run/initiatorname.iscsi /dev/.initiatorname.iscsi
712866
@@ -123,10 +123,7 @@ if [ -z $iscsi_initiator ] && [ -f /sys/firmware/ibft/initiator/initiator-name ]
712866
     mkdir -p /etc/iscsi
712866
     ln -fs /run/initiatorname.iscsi /etc/iscsi/initiatorname.iscsi
712866
     > /tmp/iscsi_set_initiator
712866
-    if systemctl --quiet is-active iscsid.service; then
712866
-        systemctl restart iscsid
712866
-        sleep 1
712866
-    fi
712866
+    systemctl try-restart iscsid && sleep 1
712866
 fi
712866
 
712866