From 5d23b62143dd174e7e10552c0e5620e54417a70b 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 25b921dd61..dbdf2bd17c 100644 --- a/nvmf-autoconnect/dracut-95nbft/nbft-boot-connect.service.in +++ b/nvmf-autoconnect/dracut-95nbft/nbft-boot-connect.service.in @@ -13,6 +13,11 @@ Before=remote-fs-pre.target [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