Blame SOURCES/0150-iscsi-boot-related-service-file-updates.patch

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