Blob Blame Raw
From 6ee8a34d108d8d3663da057cad210372e80cb65c Mon Sep 17 00:00:00 2001
From: Chris Leech <cleech@redhat.com>
Date: Wed, 26 Feb 2014 16:33:48 -0800
Subject: [PATCH] update handling of boot sessions

force start iscsiuio if needed, socket activation does not seem to be
working for recovery
---
 etc/systemd/iscsi-mark-root-nodes | 29 +++++++++++++++++++++++------
 1 file changed, 23 insertions(+), 6 deletions(-)

diff --git a/etc/systemd/iscsi-mark-root-nodes b/etc/systemd/iscsi-mark-root-nodes
index 157be62..60dcd70 100644
--- a/etc/systemd/iscsi-mark-root-nodes
+++ b/etc/systemd/iscsi-mark-root-nodes
@@ -1,13 +1,30 @@
 #!/bin/bash
 
 ISCSIADM=/sbin/iscsiadm
+start_iscsid=0
+start_iscsiuio=0
 
-$ISCSIADM -m session >/dev/null 2>&1 || exit 0
+while read t num p target flash; do
+  # strip tag number from portal, keep "ip:port"
+  portal=${p%,*}
+  transport=${t%:}
 
-$ISCSIADM -m session | while read t num i target; do
-  ip=${i%:*}
-  $ISCSIADM -m node -p $ip -T $target -o update -n node.startup -v onboot
-done
+  $ISCSIADM -m node -p $portal -T $target -o update -n node.startup -v onboot
 
-systemctl start iscsid.service
+  start_iscsid=1
+
+  if [ "$transport" = bnx2i ]; then
+    start_iscsiuio=1
+  fi
+done < <( $ISCSIADM -m session )
+
+# force iscsid and iscsiuio to start if needed for
+# recovering sessions created in the initrd
+
+if [ "$start_iscsid" -eq 1 ]; then
+  systemctl --no-block start iscsid.service
+fi
+if [ "$start_iscsiuio" -eq 1 ]; then
+  systemctl --no-block start iscsiuio.service
+fi
 
-- 
2.1.0