summaryrefslogtreecommitdiffstats
path: root/builder
diff options
context:
space:
mode:
authortorben2015-11-20 18:04:24 +0100
committertorben2015-11-20 18:04:24 +0100
commitd6a46151403a93262a92fc85de335fa7591b9c5a (patch)
tree673853ac7efebbdea52ce740a57f82bd4572cc25 /builder
parentFIX CONSOLE IN INITRAMFS!!!!!! (diff)
downloadsystemd-init-d6a46151403a93262a92fc85de335fa7591b9c5a.tar.gz
systemd-init-d6a46151403a93262a92fc85de335fa7591b9c5a.tar.xz
systemd-init-d6a46151403a93262a92fc85de335fa7591b9c5a.zip
Adding more resilient configuration server api.
Diffstat (limited to 'builder')
-rwxr-xr-xbuilder/dnbd3-rootfs/hooks/pre-mount/fetch-config.sh15
-rwxr-xr-xbuilder/dnbd3-rootfs/hooks/pre-mount/prepare-root-partition.sh2
2 files changed, 12 insertions, 5 deletions
diff --git a/builder/dnbd3-rootfs/hooks/pre-mount/fetch-config.sh b/builder/dnbd3-rootfs/hooks/pre-mount/fetch-config.sh
index 411b2f7d..058edeed 100755
--- a/builder/dnbd3-rootfs/hooks/pre-mount/fetch-config.sh
+++ b/builder/dnbd3-rootfs/hooks/pre-mount/fetch-config.sh
@@ -2,11 +2,18 @@ command -v getarg >/dev/null || . /lib/dracut-lib.sh
local configuration_file_name='config'
info 'Getting configuration file.'
-wget --timeout 5 --quiet "http://${SLX_SERVER}${SLX_SERVER_BASE}${configuration_file_name}" \
- --output-document "/$configuration_file_name"
-local return_code="$?"
+local IFS_backup="$IFS"
+IFS=","
+local host
+for host in ${SLX_SERVER}; do
+ wget --timeout 5 --quiet "http://${host}${SLX_SERVER_BASE}${configuration_file_name}" \
+ --output-document "/$configuration_file_name"
+ local return_code="$?"
+ [[ $return_code != 0 ]] && continue
+done
+IFS="$IFS_backup"
if [[ $return_code != 0 ]]; then
- warn "Downloading OpenSLX configuration file from \"${SLX_SERVER}${SLX_SERVER_BASE}${configuration_file_name}\" failed. Return code: $return_code"
+ warn "Downloading OpenSLX configuration file from all server in \"${SLX_SERVER}\" in location \"${SLX_SERVER_BASE}${configuration_file_name}\" failed. Return code: $return_code"
emergency_shell -n "$0"
return 1
fi
diff --git a/builder/dnbd3-rootfs/hooks/pre-mount/prepare-root-partition.sh b/builder/dnbd3-rootfs/hooks/pre-mount/prepare-root-partition.sh
index c7b2c1a5..4a5b57f3 100755
--- a/builder/dnbd3-rootfs/hooks/pre-mount/prepare-root-partition.sh
+++ b/builder/dnbd3-rootfs/hooks/pre-mount/prepare-root-partition.sh
@@ -6,7 +6,7 @@ if ! systemd-preserve-process-marker dnbd3-client --host "$SLX_DNBD3_SERVERS" \
--image "${SLX_SERVER_BASE}${SLX_DNBD3_IMAGE}" --device \
"$SLX_DNBD3_DEVICE" --rid "$SLX_DNBD3_RID"
then
- warn "Failed to connect $SLX_DNBD3_IMAGE from $SLX_DNBD3_SERVER to $SLX_DNBD3_DEVICE"
+ warn "Failed to connect $SLX_DNBD3_IMAGE from $SLX_DNBD3_SERVERS to $SLX_DNBD3_DEVICE"
emergency_shell -n "Error in $0"
return 1
fi