54e364
From c7b743486c6a499a037744760846abdb42959808 Mon Sep 17 00:00:00 2001
fbd856
From: Chris Leech <cleech@redhat.com>
fbd856
Date: Wed, 26 Feb 2014 16:33:48 -0800
54e364
Subject: [PATCH 14/32] update handling of boot sessions
fbd856
fbd856
force start iscsiuio if needed, socket activation does not seem to be
fbd856
working for recovery
fbd856
---
fbd856
 etc/systemd/iscsi-mark-root-nodes | 29 +++++++++++++++++++++++------
fbd856
 1 file changed, 23 insertions(+), 6 deletions(-)
fbd856
fbd856
diff --git a/etc/systemd/iscsi-mark-root-nodes b/etc/systemd/iscsi-mark-root-nodes
54e364
index 157be62b4041..6bddf6c5ccc1 100644
fbd856
--- a/etc/systemd/iscsi-mark-root-nodes
fbd856
+++ b/etc/systemd/iscsi-mark-root-nodes
fbd856
@@ -1,13 +1,30 @@
fbd856
 #!/bin/bash
fbd856
 
fbd856
 ISCSIADM=/sbin/iscsiadm
fbd856
+start_iscsid=0
fbd856
+start_iscsiuio=0
fbd856
 
fbd856
-$ISCSIADM -m session >/dev/null 2>&1 || exit 0
fbd856
+while read t num p target flash; do
fbd856
+  # strip tag number from portal, keep "ip:port"
fbd856
+  portal=${p%,*}
fbd856
+  transport=${t%:}
fbd856
 
fbd856
-$ISCSIADM -m session | while read t num i target; do
fbd856
-  ip=${i%:*}
fbd856
-  $ISCSIADM -m node -p $ip -T $target -o update -n node.startup -v onboot
fbd856
-done
fbd856
+  $ISCSIADM -m node -p $portal -T $target -o update -n node.startup -v onboot
fbd856
 
fbd856
-systemctl start iscsid.service
fbd856
+  start_iscsid=1
fbd856
+
54e364
+  if [ "$transport" = bnx2i ] || [ "$transport" = qedi ]; then
fbd856
+    start_iscsiuio=1
fbd856
+  fi
fbd856
+done < <( $ISCSIADM -m session )
fbd856
+
fbd856
+# force iscsid and iscsiuio to start if needed for
fbd856
+# recovering sessions created in the initrd
fbd856
+
fbd856
+if [ "$start_iscsid" -eq 1 ]; then
fbd856
+  systemctl --no-block start iscsid.service
fbd856
+fi
fbd856
+if [ "$start_iscsiuio" -eq 1 ]; then
fbd856
+  systemctl --no-block start iscsiuio.service
fbd856
+fi
fbd856
 
fbd856
-- 
54e364
2.14.4
fbd856