From 9d7538838ce2aa8ac2211fb53cd9b3656e48d51b Mon Sep 17 00:00:00 2001 From: Michael Shigorin Date: Sat, 1 Feb 2014 18:22:36 +0400 Subject: [PATCH] live, net-eth: add DHCP_TIMEOUT when appropriate It's hardwired at 1/10 of the default /etc/net value since 3 seconds are enough for properly functioning DHCP servers in properly maintained networks (those improper ones tend to have problems with 30 seconds anyways), and waiting for too long makes users feel bad for a reason. Thanks msp@ for bringing attention to this. --- features.in/live/live/image-scripts.d/50-setup-network | 1 + features.in/net-eth/rootfs/image-scripts.d/50-net-eth | 3 +++ 2 files changed, 4 insertions(+) diff --git a/features.in/live/live/image-scripts.d/50-setup-network b/features.in/live/live/image-scripts.d/50-setup-network index 9658e538..e1bc6d17 100755 --- a/features.in/live/live/image-scripts.d/50-setup-network +++ b/features.in/live/live/image-scripts.d/50-setup-network @@ -57,6 +57,7 @@ else mkdir -p "$prefix"/eth0 && { echo TYPE=eth echo BOOTPROTO=dhcp + echo DHCP_TIMEOUT=3 } > "$prefix"/eth0/options else verbose "NOT configuring eth0 for DHCP" diff --git a/features.in/net-eth/rootfs/image-scripts.d/50-net-eth b/features.in/net-eth/rootfs/image-scripts.d/50-net-eth index 4fbe4658..f40642bd 100755 --- a/features.in/net-eth/rootfs/image-scripts.d/50-net-eth +++ b/features.in/net-eth/rootfs/image-scripts.d/50-net-eth @@ -19,8 +19,10 @@ IFACEDIR="/etc/net/ifaces" write_iface() { dir="$IFACEDIR/$iface" mkdir -p "$dir" + append= case "$proto" in dhcp) + append="DHCP_TIMEOUT=3" ;; static) [ -n "$ipv4addr" ] || fatal "ipv4addr missing" @@ -39,6 +41,7 @@ write_iface() { echo "NM_CONTROLLED=$NMCTL" echo "DISABLED=$NMCTL" echo "#USE_IFPLUGD=yes" + [ -z "$append"] || echo "$append" } > "$dir/options" }