From 24730082f35e0d4dad21909175419cbf010450ec Mon Sep 17 00:00:00 2001 From: Tomas Bzatek Date: Mon, 2 Dec 2024 18:24:05 +0100 Subject: [PATCH] dracut/95nbft: Define respawn attempts on a connection failure In case the `nvme connect-all --nbft` call fails, respawn the service after 10 seconds and try again. Depends on nvme-cli to return non-zero status in case of any of the SSNS records that are not marked as 'unavailable' fails to connect. The respawn cycle is broken by stopping the unit once rootfs is mounted and system switches the root. Signed-off-by: Tomas Bzatek --- nvmf-autoconnect/dracut-95nbft/nbft-boot-connect.service.in | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/nvmf-autoconnect/dracut-95nbft/nbft-boot-connect.service.in b/nvmf-autoconnect/dracut-95nbft/nbft-boot-connect.service.in index f2deebf40a..652865b7e3 100644 --- a/nvmf-autoconnect/dracut-95nbft/nbft-boot-connect.service.in +++ b/nvmf-autoconnect/dracut-95nbft/nbft-boot-connect.service.in @@ -14,6 +14,11 @@ Before=dracut-initqueue.service [Service] RestrictAddressFamilies=AF_INET AF_INET6 Type=oneshot +# Connection attempt recovery +Restart=on-failure +RestartSec=10 +StartLimitIntervalSec=0 +StartLimitBurst=0 # No 'modprobe@.service' available in the initramfs ExecStartPre=-/sbin/modprobe nvme-fabrics ExecStart=/usr/sbin/nvme connect-all --nbft