From b3e7af1ceb496a74661d6453699ba57a3cb3c6a4 Mon Sep 17 00:00:00 2001 From: Jonathan Bauer Date: Fri, 13 Aug 2021 15:25:20 +0200 Subject: [dnbd3-rootfs] let dnbd3 try all servers on its own --- .../dnbd3-rootfs/hooks/prepare-root-partition.sh | 23 ++++++++++------------ 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/modules.d/dnbd3-rootfs/hooks/prepare-root-partition.sh b/modules.d/dnbd3-rootfs/hooks/prepare-root-partition.sh index 35b4204f..70af9d68 100755 --- a/modules.d/dnbd3-rootfs/hooks/prepare-root-partition.sh +++ b/modules.d/dnbd3-rootfs/hooks/prepare-root-partition.sh @@ -69,25 +69,22 @@ if [ -n "$SLX_DNBD3_RID" ]; then fi IFS=", " -for try in {1..5} FAIL; do - if [ "$try" = "FAIL" ]; then +for try in {1..5} ""; do + if [ -z "$try" ]; then emergency_shell "Failed to connect '${SLX_DNBD3_IMAGE}'" \ "(revision: ${SLX_DNBD3_RID:-0})" \ "from one of '$SLX_DNBD3_SERVERS' to '$_dnbd3_dev'." \ "Check if the image exists on one of the servers" \ "and if any is reachable from this client." fi - for host in ${SLX_DNBD3_SERVERS}; do - info "Trying host \"$host\"." - if systemd-preserve-process-marker dnbd3-client \ - --host "$host" \ - --image "${SLX_DNBD3_IMAGE}" \ - --device "$_dnbd3_dev" \ - "${_dnbd3_client_additional_args[@]}"; then - break 2 - fi - sleep 1 - done + info "Trying hosts '$SLX_DNBD3_SERVERS'." + if dnbd3-client \ + --host "$SLX_DNBD3_SERVERS" \ + --image "$SLX_DNBD3_IMAGE" \ + --device "$_dnbd3_dev" \ + "${_dnbd3_client_additional_args[@]}"; then + fi + sleep 1 done # endregion -- cgit v1.2.3-55-g7522