File 0004-nvmf-autoconnect.service.patch of Package nvme-cli.18908
From: Hannes Reinecke <hare@suse.de>
Date: Wed, 22 Jan 2020 08:45:18 +0100
Subject: [PATCH] nvmf-autoconnect.service
Git-commit: c28523e76544fb44a9b6d7aa40e42bc5ffea256e Mon Sep 17 00:00:00 2001
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 | 12 ++++++++++++
1 file changed, 12 insertions(+)
create mode 100644 nvmf-autoconnect/systemd/nvmf-autoconnect.service
diff --git a/nvmf-autoconnect/systemd/nvmf-autoconnect.service b/nvmf-autoconnect/systemd/nvmf-autoconnect.service
new file mode 100644
index 0000000..2690467
--- /dev/null
+++ b/nvmf-autoconnect/systemd/nvmf-autoconnect.service
@@ -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
--
2.13.7