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