]> git.pld-linux.org Git - projects/rc-scripts.git/commitdiff
- another example of zsh supremacy in shell world! fixed 5 yrs old flaw
authorTomasz Pala <gotar@pld-linux.org>
Sat, 6 Oct 2012 16:33:59 +0000 (16:33 +0000)
committerTomasz Pala <gotar@pld-linux.org>
Sat, 6 Oct 2012 16:33:59 +0000 (16:33 +0000)
  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.

svn-id: @12592

lib/ifup

index da9da7b01d610ed84ceb00024144c862d558b8ea..013c3558b99d4874e33119e1170c0e85ac07bb41 100755 (executable)
--- a/lib/ifup
+++ b/lib/ifup
@@ -225,7 +225,7 @@ else
        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
This page took 0.391979 seconds and 4 git commands to generate.