|
|
d94dff |
From 56d9d1c6a02dcad0915c0673f9cd2e653c86302f Mon Sep 17 00:00:00 2001
|
|
|
d94dff |
From: rpm-build <rpm-build>
|
|
|
d94dff |
Date: Tue, 13 Jan 2015 16:30:01 -0800
|
|
|
d94dff |
Subject: [PATCH] 0171-make-session-shutdown-a-seperate-service.patch
|
|
|
d94dff |
|
|
|
d94dff |
---
|
|
|
d94dff |
etc/systemd/iscsi-shutdown.service | 14 ++++++++++++++
|
|
|
d94dff |
etc/systemd/iscsi.service | 3 +--
|
|
|
d94dff |
2 files changed, 15 insertions(+), 2 deletions(-)
|
|
|
d94dff |
create mode 100644 etc/systemd/iscsi-shutdown.service
|
|
|
d94dff |
|
|
|
d94dff |
diff --git a/etc/systemd/iscsi-shutdown.service b/etc/systemd/iscsi-shutdown.service
|
|
|
d94dff |
new file mode 100644
|
|
|
d94dff |
index 0000000..23758e9
|
|
|
d94dff |
--- /dev/null
|
|
|
d94dff |
+++ b/etc/systemd/iscsi-shutdown.service
|
|
|
d94dff |
@@ -0,0 +1,15 @@
|
|
|
d94dff |
+[Unit]
|
|
|
d94dff |
+Description=Logout off all iSCSI sessions on shutdown
|
|
|
d94dff |
+Documentation=man:iscsid(8) man:iscsiadm(8)
|
|
|
d94dff |
+DefaultDependencies=no
|
|
|
d94dff |
+Conflicts=shutdown.target
|
|
|
d94dff |
+After=systemd-remount-fs.service network.target iscsid.service iscsiuio.service
|
|
|
d94dff |
+Before=remote-fs-pre.target
|
|
|
d94dff |
+Wants=remote-fs-pre.target
|
|
|
d94dff |
+RefuseManualStop=yes
|
|
|
d94dff |
+
|
|
|
d94dff |
+[Service]
|
|
|
d94dff |
+Type=oneshot
|
|
|
d94dff |
+RemainAfterExit=true
|
|
|
d94dff |
+ExecStart=-/bin/true
|
|
|
d94dff |
+ExecStop=-/sbin/iscsiadm -m node --logoutall=all
|
|
|
d94dff |
diff --git a/etc/systemd/iscsi.service b/etc/systemd/iscsi.service
|
|
|
d94dff |
index ad7be34..2736956 100644
|
|
|
d94dff |
--- a/etc/systemd/iscsi.service
|
|
|
d94dff |
+++ b/etc/systemd/iscsi.service
|
|
|
d94dff |
@@ -5,7 +5,7 @@ DefaultDependencies=no
|
|
|
d94dff |
Conflicts=shutdown.target
|
|
|
d94dff |
After=systemd-remount-fs.service network.target iscsid.service iscsiuio.service
|
|
|
d94dff |
Before=remote-fs-pre.target
|
|
|
d94dff |
-Wants=remote-fs-pre.target
|
|
|
d94dff |
+Wants=remote-fs-pre.target iscsi-shutdown.service
|
|
|
d94dff |
ConditionDirectoryNotEmpty=|/var/lib/iscsi/nodes
|
|
|
d94dff |
ConditionDirectoryNotEmpty=|/sys/class/iscsi_session
|
|
|
d94dff |
|
|
|
d94dff |
@@ -14,7 +14,6 @@ Type=oneshot
|
|
|
d94dff |
RemainAfterExit=true
|
|
|
d94dff |
ExecStart=-/usr/libexec/iscsi-mark-root-nodes
|
|
|
d94dff |
ExecStart=-/sbin/iscsiadm -m node --loginall=automatic
|
|
|
d94dff |
-ExecStop=-/sbin/iscsiadm -m node --logoutall=automatic
|
|
|
d94dff |
ExecReload=-/sbin/iscsiadm -m node --loginall=automatic
|
|
|
d94dff |
|
|
|
d94dff |
[Install]
|
|
|
d94dff |
--
|
|
|
d94dff |
2.1.0
|
|
|
d94dff |
|