Merge "Checking link status according to DIB_DHCP_TIMEOUT"

This commit is contained in:
Zuul 2018-02-28 11:42:50 +00:00 committed by Gerrit Code Review
commit 05a44e2181
3 changed files with 4 additions and 3 deletions

View file

@ -25,5 +25,5 @@ DIB_DHCP_TIMEOUT
:Required: No
:Default: 30
:Description: Amount of time in seconds that the systemd service will
wait to get an address.
wait to get an address. Should be increased in networks such as Infiniband.
:Example: DIB_DHCP_TIMEOUT=300

View file

@ -11,6 +11,7 @@ SCRIPTDIR=$(dirname $0)
# this script is not needed on Gentoo.
if [ "$DISTRO_NAME" != "gentoo" ]; then
install -D -g root -o root -m 0755 ${SCRIPTDIR}/dhcp-all-interfaces.sh /usr/local/sbin/dhcp-all-interfaces.sh
sed -i "s/DIB_DHCP_TIMEOUT/${DIB_DHCP_TIMEOUT:-30}/" /usr/local/sbin/dhcp-all-interfaces.sh
fi
if [ "$DIB_INIT_SYSTEM" == "upstart" ]; then

View file

@ -97,8 +97,8 @@ function inspect_interface() {
echo "Device has generated MAC, skipping."
else
local has_link
local tries
for ((tries = 0; tries < 20; tries++)); do
local tries=DIB_DHCP_TIMEOUT
for ((; tries > 0; tries--)); do
# Need to set the link up on each iteration
ip link set dev $interface up &>/dev/null
has_link=$(get_if_link $interface)