summaryrefslogtreecommitdiff
path: root/etc/systemd/iscsi-init.service.template
diff options
context:
space:
mode:
Diffstat (limited to 'etc/systemd/iscsi-init.service.template')
-rw-r--r--etc/systemd/iscsi-init.service.template19
1 files changed, 19 insertions, 0 deletions
diff --git a/etc/systemd/iscsi-init.service.template b/etc/systemd/iscsi-init.service.template
new file mode 100644
index 0000000..8f9a8aa
--- /dev/null
+++ b/etc/systemd/iscsi-init.service.template
@@ -0,0 +1,19 @@
+[Unit]
+Description=One time configuration for iscsi.service
+ConditionPathExists=!/etc/iscsi/initiatorname.iscsi
+DefaultDependencies=no
+RequiresMountsFor=/etc/iscsi
+# systemd-remount-fs.service is optionally pulled in by
+# local-fs.target, don't start it here (no Wants=) but if
+# it's running wait for it to finish
+After=systemd-remount-fs.service
+
+[Install]
+# this ensures we are in the same transaction with
+# systemd-remount-fs.service
+WantedBy=systemd-remount-fs.service
+
+[Service]
+Type=oneshot
+RemainAfterExit=no
+ExecStart=/usr/bin/sh -c 'echo "InitiatorName=`@SBINDIR@/iscsi-iname`" > /etc/iscsi/initiatorname.iscsi'