]> www.infradead.org Git - users/hch/nvme-cli.git/commitdiff
nvmf-autoconnect.service
authorHannes Reinecke <hare@suse.de>
Wed, 22 Jan 2020 07:45:18 +0000 (08:45 +0100)
committerKeith Busch <kbusch@kernel.org>
Thu, 23 Jan 2020 21:35:40 +0000 (14:35 -0700)
Add a systemd service to automatically start 'nvme connect-all'
upon booting if an /etc/nvme/discovery.conf file exists.
The 'nvme-tcp' or 'nvme-rdma' modules need to be loaded earlier
by eg the modules-load service.

Signed-off-by: Hannes Reinecke <hare@suse.com>
nvmf-autoconnect/systemd/nvmf-autoconnect.service [new file with mode: 0644]

diff --git a/nvmf-autoconnect/systemd/nvmf-autoconnect.service b/nvmf-autoconnect/systemd/nvmf-autoconnect.service
new file mode 100644 (file)
index 0000000..2690467
--- /dev/null
@@ -0,0 +1,12 @@
+[Unit]
+Description=Connect NVMe-oF subsystems automatically during boot
+ConditionPathExists=/etc/nvme/discovery.conf
+After=network.target
+Before=remote-fs-pre.target
+
+[Service]
+Type=oneshot
+ExecStart=/usr/sbin/nvme connect-all
+
+[Install]
+WantedBy=default.target