Skip to content

Commit

Permalink
systemd: remove rudimentary network checking code
Browse files Browse the repository at this point in the history
Now that we have After=network-online.target added in 35b41f9
NetworkManager is handling this for us and we don't need this
crude network online checking.
  • Loading branch information
dustymabe committed Jan 7, 2020
1 parent 35b41f9 commit e7502b4
Showing 1 changed file with 1 addition and 31 deletions.
32 changes: 1 addition & 31 deletions systemd/coreos-installer-service
Original file line number Diff line number Diff line change
Expand Up @@ -41,37 +41,6 @@ copy_arg() {
fi
}

# Wait for the network to be up by trying to HEAD a URL.
# There are a few corner cases we have to account for:
#
# - The user gave both ignition_url and image_url
# - We need to try both URLs because one could be IP
# based and the other could be DNS based. If both are
# IP based then we don't need to wait on DNS.
# - The user provided only image_url
# - This case is simple. Check image_url and continue.
# - The user did not provide image_url
# - This case implies we are going to contact a remote
# service (most likely fedora infra) so we need to
# test DNS is working befrore continuing. In this case
# we'll check the fedora hotspot globally accessible URL:
# http://fedoraproject.org/static/hotspot.txt
#
ignition_url="$(karg coreos.inst.ignition_url)"
image_url="$(karg coreos.inst.image_url)"
check_urls="${image_url:-http://fedoraproject.org/static/hotspot.txt}"
if [ -n "${ignition_url}" -a "${ignition_url}" != "skip" ]; then
check_urls+=" ${ignition_url}"
fi
for check_url in $check_urls; do
# We'd like to disable the progress meter but we can only do that
# completely with --silent, which also disables status updates. Use
# the compact progress bar instead, since at least it's smaller.
curl --head --progress-bar --fail \
--retry 60 --retry-delay 1 --retry-connrefused \
-o /dev/null "${check_url}"
done

# Get install device
device="$(karg coreos.inst.install_dev)"
if [ -z "${device}" ]; then
Expand All @@ -85,6 +54,7 @@ fi
args+=("${device}")

# Fetch the Ignition URL, if any, and cache it locally.
ignition_url="$(karg coreos.inst.ignition_url)"
# Ignore "skip" for compatibility
if [ -n "${ignition_url}" -a "${ignition_url}" != "skip" ]; then
ignition_file="$(mktemp -t coreos-installer-XXXXXX)"
Expand Down

0 comments on commit e7502b4

Please sign in to comment.