Skip to contentSkip to conversation

nvmetcli: set up the target only after the network is configured

PATCH Applied Maurizio Lombardi 3 participants 3 messages Feb 28, 2023 – Mar 15, 2023 NVMe

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 nvmetcli: set up the target only after the network is configured

network.target only indicates that the network stack is up, but it doesn't mean that the network devices have been configured.

Replace it with network-online.target, this fixes the following error when systemd restores the target configuration during boot:

[   19.613251] nvmet_tcp: failed to bind port socket -99

[FAILED] Failed to start Restore NVMe kernel target configuration.

---
 nvmet.service | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
nvmet.service +2 -1
index 5c7991e..6f97a91 100644
@@ -1,7 +1,8 @@
 [Unit]
 Description=Restore NVMe kernel target configuration
 Requires=sys-kernel-config.mount
-After=sys-kernel-config.mount network.target local-fs.target
+After=sys-kernel-config.mount network-online.target local-fs.target
+Wants=network-online.target
 
 [Service]
 Type=oneshot
Signature · 1 line
2.31.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 11 lines · Maurizio Lombardi

network.target only indicates that the network stack is up, but it doesn't mean that the network devices have been configured.

Replace it with network-online.target, this fixes the following error when systemd restores the target configuration during boot:

[   19.613251] nvmet_tcp: failed to bind port socket -99

[FAILED] Failed to start Restore NVMe kernel target configuration.

---

I believe you have tested this thoroughly with other transports.

-ck