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

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