SVN: rc-scripts/trunk/lib/ifup

gotar gotar at pld-linux.org
Sat Oct 6 18:34:00 CEST 2012


Author: gotar
Date: Sat Oct  6 18:33:59 2012
New Revision: 12592

Modified:
   rc-scripts/trunk/lib/ifup
Log:
- another example of zsh supremacy in shell world! fixed 5 yrs old flaw
  introduced in rev. 8719 that neither pdksh nor mksh handled properly,
  not to mention bash - such process backgrounding caused, when called
  from functions/run_cmd (i.e. during service network start), I/O wait
  for STDOUT of 'background' job despite >/dev/null redirects; this
  effectively leads to 2 seconds delay for each interface at system
  startup, cumulating to minutes of pointless waiting on heavy networked
  machines! There is alternate workaround: { { sleep 2; } & } >/dev/null
  that works as expected under pdksh or mksh, but requires additional &
  for zsh and doesn't fix bash behaviour, so please do not touch _THIS_
  solution without comprehensive research! -- Aug 29th, 2012, /me
  Note: this happens due to $() capture, so plain ifup isn't enough.


Modified: rc-scripts/trunk/lib/ifup
==============================================================================
--- rc-scripts/trunk/lib/ifup	(original)
+++ rc-scripts/trunk/lib/ifup	Sat Oct  6 18:33:59 2012
@@ -225,7 +225,7 @@
 	if is_yes "$IPV4_NETWORKING" && [ -n "${IP4ADDR}" -a -x /sbin/arping ]; then
 		# update ARP cache of neighbouring computers
 		/sbin/arping -q -A -c 1 -I ${DEVICE} ${IP4ADDR%/*}
-		( sleep 2; /sbin/arping -q -U -c 1 -I ${DEVICE} ${IP4ADDR%/*} ) > /dev/null 2>&1 < /dev/null &
+		{ ( sleep 2; /sbin/arping -q -U -c 1 -I ${DEVICE} ${IP4ADDR%/*} ) & } > /dev/null 2>&1
 	fi
 
 	# IPv4/6 gateways and default routes


More information about the pld-cvs-commit mailing list