summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJonathan Bauer2021-08-13 15:25:20 +0200
committerJonathan Bauer2021-08-13 15:25:20 +0200
commitb3e7af1ceb496a74661d6453699ba57a3cb3c6a4 (patch)
treec5963517919a7088feace0c27640e1c7c5e243dc
parent[busybox] compat: /bin/ash in NEWROOT (diff)
downloadsystemd-init-b3e7af1ceb496a74661d6453699ba57a3cb3c6a4.tar.gz
systemd-init-b3e7af1ceb496a74661d6453699ba57a3cb3c6a4.tar.xz
systemd-init-b3e7af1ceb496a74661d6453699ba57a3cb3c6a4.zip
[dnbd3-rootfs] let dnbd3 try all servers on its own
-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