iscsi-initiator-utils/SOURCES/0014-update-handling-of-boot-sessions.patch

56 lines
1.6 KiB
Diff

From c7b743486c6a499a037744760846abdb42959808 Mon Sep 17 00:00:00 2001
From: Chris Leech <cleech@redhat.com>
Date: Wed, 26 Feb 2014 16:33:48 -0800
Subject: [PATCH 14/32] 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 157be62b4041..6bddf6c5ccc1 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 ] || [ "$transport" = qedi ]; 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.14.4