Wow, this bug drove me nuts when I was doing some unrelated reboots
yesterday.

That whole function seems kind of strange to me (making a directory to
pass state from one part of the function to another...?).

Here's a patch that makes the function seem cleaner to me, if anybody
wants it.

-Corey
Index: debian/src/initscripts/etc/network/if-up.d/mountnfs
===================================================================
--- debian/src/initscripts/etc/network/if-up.d/mountnfs (revision 1966)
+++ debian/src/initscripts/etc/network/if-up.d/mountnfs (working copy)
@@ -117,20 +117,15 @@
 }
 
 exit_unless_last_interface() {
-    grep "^[:space:]*auto" /etc/network/interfaces  | \
-       sed -e 's/[ \t]*auto[ \t]*//;s/[ \t]*$//;s/[ \t]/\n/g' | \
-       while read i; do
-       if [ `grep -c $i /etc/network/run/ifstate` -eq "0" ]; then
+    ifaces="$(grep "^[[:space:]]*auto" /etc/network/interfaces  | \
+        sed -e 's/[ \t]*auto[ \t]*//;s/[ \t]*$//;s/[ \t]/\n/g')"
+    for i in $ifaces ; do
+       if grep -q $i /etc/network/run/ifstate ; then
            msg="if-up.d/mountnfs[$IFACE]: waiting for interface $i before 
doing NFS mounts"
            log_warning_msg "$msg"
-           # Can not pass this as a variable because of the while subshell
-           mkdir /var/run/network/mountnfs_earlyexit 2> /dev/null
+           exit 0
        fi
     done
-    if [ -d /var/run/network/mountnfs_earlyexit ]; then
-       rmdir /var/run/network/mountnfs_earlyexit 2>/dev/null
-       exit 0
-    fi
 }
 
 # Using 'no !=' instead of 'yes =' to make sure async nfs mounting is

Reply via email to