Blame SOURCES/0149-update-systemd-service-files-add-iscsi.service-for-s.patch

6c64be
From 1c3b1d23e0b3f17399ffd4463cafad813b0444d5 Mon Sep 17 00:00:00 2001
6c64be
From: Chris Leech <cleech@redhat.com>
6c64be
Date: Wed, 19 Dec 2012 15:07:36 -0800
6c64be
Subject: update systemd service files, add iscsi.service for starting
6c64be
 sessions on boot
6c64be
6c64be
Signed-off-by: Chris Leech <cleech@redhat.com>
6c64be
---
6c64be
 etc/systemd/iscsi.service         | 19 +++++++++++++++++++
6c64be
 etc/systemd/iscsi_mark_root_nodes | 14 ++++++++++++++
6c64be
 etc/systemd/iscsid.service        |  7 +++++--
6c64be
 etc/systemd/iscsid.socket         |  2 +-
6c64be
 4 files changed, 39 insertions(+), 3 deletions(-)
6c64be
 create mode 100644 etc/systemd/iscsi.service
6c64be
 create mode 100755 etc/systemd/iscsi_mark_root_nodes
6c64be
6c64be
diff --git a/etc/systemd/iscsi.service b/etc/systemd/iscsi.service
6c64be
new file mode 100644
6c64be
index 0000000..bbd52fd
6c64be
--- /dev/null
6c64be
+++ b/etc/systemd/iscsi.service
6c64be
@@ -0,0 +1,19 @@
6c64be
+[Unit]
6c64be
+Description=Login and scanning of iSCSI devices
6c64be
+Documentation=man:iscsid(8) man:iscsiadm(8)
6c64be
+DefaultDependencies=no
6c64be
+Conflicts=shutdown.target
6c64be
+After=systemd-remount-fs.service network.target iscsid.service iscsiuio.service
6c64be
+Before=remote-fs-pre.target
6c64be
+ConditionPathExists=/etc/iscsi/initiatorname.iscsi
6c64be
+
6c64be
+[Service]
6c64be
+Type=oneshot
6c64be
+RemainAfterExit=true
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
+
6c64be
+[Install]
6c64be
+WantedBy=sysinit.target
6c64be
diff --git a/etc/systemd/iscsi_mark_root_nodes b/etc/systemd/iscsi_mark_root_nodes
6c64be
new file mode 100755
6c64be
index 0000000..c68475c
6c64be
--- /dev/null
6c64be
+++ b/etc/systemd/iscsi_mark_root_nodes
6c64be
@@ -0,0 +1,14 @@
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
diff --git a/etc/systemd/iscsid.service b/etc/systemd/iscsid.service
6c64be
index 028e0b3..653dd08 100644
6c64be
--- a/etc/systemd/iscsid.service
6c64be
+++ b/etc/systemd/iscsid.service
6c64be
@@ -1,7 +1,10 @@
6c64be
 [Unit]
6c64be
 Description=Open-iSCSI
6c64be
-Documentation=man:iscsid(8) man:iscsiuio(8) man:iscsiadm(8)
6c64be
-After=network.target NetworkManager-wait-online.service iscsiuio.service tgtd.service targetcli.service
6c64be
+Documentation=man:iscsid(8) man:iscsiadm(8)
6c64be
+DefaultDependencies=no
6c64be
+Conflicts=shutdown.target
6c64be
+After=network.target iscsiuio.service
6c64be
+Before=remote-fs-pre.target
6c64be
 
6c64be
 [Service]
6c64be
 Type=forking
6c64be
diff --git a/etc/systemd/iscsid.socket b/etc/systemd/iscsid.socket
6c64be
index 832451d..58a8d12 100644
6c64be
--- a/etc/systemd/iscsid.socket
6c64be
+++ b/etc/systemd/iscsid.socket
6c64be
@@ -1,6 +1,6 @@
6c64be
 [Unit]
6c64be
 Description=Open-iSCSI iscsid Socket
6c64be
-Documentation=man:iscsid(8) man:iscsiuio(8) man:iscsiadm(8)
6c64be
+Documentation=man:iscsid(8) man:iscsiadm(8)
6c64be
 
6c64be
 [Socket]
6c64be
 ListenStream=@ISCSIADM_ABSTRACT_NAMESPACE
6c64be
-- 
6c64be
1.7.11.7
6c64be