summaryrefslogtreecommitdiff
path: root/etc/systemd/iscsi-init.service.template
blob: 8f9a8aa7260312a1eaa77bab3fb669dff7d05efc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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'