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.
Signed-off-by: Maurizio Lombardi <mlombard@redhat.com>
Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
[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