From f71a1391f8819a26e9ace72406402c2bc96c8a9e Mon Sep 17 00:00:00 2001 From: Adam Osuchowski Date: Sat, 23 Dec 2017 13:30:02 +0100 Subject: [PATCH] - add support for CHECK_LINK_WAIT_TIMEOUT config variable (wait max x sec for interface link up) --- lib/ifup | 3 ++- sysconfig/interfaces/ifcfg-description | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/ifup b/lib/ifup index b0c03f57..dee4e58b 100755 --- a/lib/ifup +++ b/lib/ifup @@ -176,7 +176,8 @@ if [ -n "$BOOTPROTO" -a "$BOOTPROTO" != "none" -a "$BOOTPROTO" != "static" ]; th fi DHCP_ARGS="$DHCP_OPTIONS $DHCP_ARGS" - if check_link_down ${DEVICE}; then + [ -z "$CHECK_LINK_WAIT_TIMEOUT" ] && CHECK_LINK_WAIT_TIMEOUT=5 + if check_link_down ${DEVICE} $(( $CHECK_LINK_WAIT_TIMEOUT * 2 )); then run_cmd "$(nls 'Determining IP information for %s (%s)' "$DEVICE" "${DHCP_CLIENT##*/}")" /bin/false nls '%s: Check cable/radio on-off switch?' "$DEVICE" exit 1 diff --git a/sysconfig/interfaces/ifcfg-description b/sysconfig/interfaces/ifcfg-description index 1629ce0d..45d5a704 100644 --- a/sysconfig/interfaces/ifcfg-description +++ b/sysconfig/interfaces/ifcfg-description @@ -81,6 +81,8 @@ VLAN_REORDER_HDR=[0|1] When this is set, the VLAN device will move the [ HANDLING=0|1|2|3 ] (0 is default; used ie. in ATM configuration, for details see ifup script) +[ CHECK_LINK_WAIT_TIMEOUT= ] + if DEVICE=eth*; then [ MEDIA={auto|10baseT|10base2|AUI} ] -- 2.44.0