Blame SOURCES/0014-update-handling-of-boot-sessions.patch

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