Blame open-iscsi-v2.0.873-4c9d6f9-5-iscsi-boot-related-service-file-updates.patch

2abe1f
From 41c832215e1d76907c28eccd6b5a29d7356ae34e Mon Sep 17 00:00:00 2001
2a4a67
From: Chris Leech <cleech@redhat.com>
2a4a67
Date: Mon, 19 Aug 2013 07:18:25 -0700
929689
Subject: [PATCH] iscsi boot related service file updates
2a4a67
2a4a67
make sure iscsid gets started if there are any boot sessions running
2a4a67
add reload target to fix double session problem when restarting from NM
2a4a67
don't rely on session list passed from initrd, never got fully implemented
2a4a67
---
2a4a67
 etc/systemd/iscsi-mark-root-nodes | 13 +++++++++++++
2a4a67
 etc/systemd/iscsi.service         |  3 ++-
2a4a67
 etc/systemd/iscsi_mark_root_nodes | 14 --------------
2a4a67
 3 files changed, 15 insertions(+), 15 deletions(-)
2a4a67
 create mode 100644 etc/systemd/iscsi-mark-root-nodes
929689
 delete mode 100755 etc/systemd/iscsi_mark_root_nodes
2a4a67
2a4a67
diff --git a/etc/systemd/iscsi-mark-root-nodes b/etc/systemd/iscsi-mark-root-nodes
2a4a67
new file mode 100644
2a4a67
index 0000000..157be62
2a4a67
--- /dev/null
2a4a67
+++ b/etc/systemd/iscsi-mark-root-nodes
2a4a67
@@ -0,0 +1,13 @@
2a4a67
+#!/bin/bash
2a4a67
+
2a4a67
+ISCSIADM=/sbin/iscsiadm
2a4a67
+
2a4a67
+$ISCSIADM -m session >/dev/null 2>&1 || exit 0
2a4a67
+
2a4a67
+$ISCSIADM -m session | while read t num i target; do
2a4a67
+  ip=${i%:*}
2a4a67
+  $ISCSIADM -m node -p $ip -T $target -o update -n node.startup -v onboot
2a4a67
+done
2a4a67
+
2a4a67
+systemctl start iscsid.service
2a4a67
+
2a4a67
diff --git a/etc/systemd/iscsi.service b/etc/systemd/iscsi.service
929689
index bbd52fd..0309e2f 100644
2a4a67
--- a/etc/systemd/iscsi.service
2a4a67
+++ b/etc/systemd/iscsi.service
929689
@@ -10,10 +10,11 @@ ConditionPathExists=/etc/iscsi/initiatorname.iscsi
2a4a67
 [Service]
2a4a67
 Type=oneshot
2a4a67
 RemainAfterExit=true
2a4a67
-ExecStart=/usr/libexec/iscsi_mark_root_nodes
2a4a67
+ExecStart=/usr/libexec/iscsi-mark-root-nodes
2a4a67
 ExecStart=/sbin/iscsiadm -m node --loginall=automatic
2a4a67
 ExecStop=/bin/sync
2a4a67
 ExecStop=/sbin/iscsiadm -m node --logoutall=automatic
2a4a67
+ExecReload=/sbin/iscsiadm -m node --loginall=automatic
2a4a67
 
2a4a67
 [Install]
2a4a67
 WantedBy=sysinit.target
2a4a67
diff --git a/etc/systemd/iscsi_mark_root_nodes b/etc/systemd/iscsi_mark_root_nodes
929689
deleted file mode 100755
2a4a67
index c68475c..0000000
2a4a67
--- a/etc/systemd/iscsi_mark_root_nodes
2a4a67
+++ /dev/null
2a4a67
@@ -1,14 +0,0 @@
2a4a67
-#!/bin/bash
2a4a67
-
2a4a67
-ISCSIADM=/sbin/iscsiadm
2a4a67
-SESSION_FILE=/run/initramfs/iscsi.sessions
2a4a67
-
2a4a67
-if [ ! -f $SESSION_FILE ] ; then
2a4a67
-  exit 0
2a4a67
-fi
2a4a67
-
2a4a67
-while read t num i target; do
2a4a67
-  ip=${i%:*}
2a4a67
-  $ISCSIADM -m node -p $ip -T $target -o update -n node.startup -v onboot
2a4a67
-done < $SESSION_FILE
2a4a67
-
2a4a67
-- 
929689
2.1.0
2a4a67