summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xmodules.d/dnbd3-rootfs/hooks/prepare-root-partition.sh23
1 files 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