Skip to content

Commit

Permalink
dracut/95nbft: Define respawn attempts on a connection failure
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
tbzatek committed Feb 12, 2025
1 parent 0a8524e commit 2473008
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions nvmf-autoconnect/dracut-95nbft/nbft-boot-connect.service.in
Original file line number Diff line number Diff line change
Expand Up @@ -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 '[email protected]' available in the initramfs
ExecStartPre=-/sbin/modprobe nvme-fabrics
ExecStart=/usr/sbin/nvme connect-all --nbft
Expand Down

0 comments on commit 2473008

Please sign in to comment.