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 Dec 12, 2024
1 parent c8de288 commit 5d23b62
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 @@ -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 '[email protected]' available in the initramfs
ExecStartPre=-/sbin/modprobe nvme-fabrics
ExecStart=/usr/sbin/nvme connect-all --nbft
Expand Down

0 comments on commit 5d23b62

Please sign in to comment.