A cleaner way of mounting the nfs shares than Josep provided is
something like what I have below. It looks for whether the nfs server
responds to a ping rather than the default route and will retry 3 times
with a 3 second timeout each time. It also checks all nfs mount points
listed in /etc/fstab which largely restores the functionality of that
file.

In any case this is a work around and it seems that fixing the original
bug would be preferable to continued effort in this direction.


cat /etc/fstab | sed 's/#.*//' | grep nfs | while read LINE
do
        HOST=`echo "$LINE" | cut -f1 -d:`
        DIR=`echo "$LINE" | awk '{print $2}'`
        if ! mount -l -t nfs | awk '{print $3}' | grep -q "^$DIR$"
        then
                echo -n "Mounting '$DIR'"
                COUNT=0
                STOP=0
                while [ $STOP -eq 0 -a $COUNT -lt 3 ]
                do
                        if ping -qAc 3 $HOST > /dev/null
                        then    
                                mount $DIR
                                STOP=1  
                                echo " done."
                        else    
                                # no sleep needed here because ping will take 3 
seconds to fail anyway
                                COUNT=$( expr $COUNT + 1 )
                                echo -n "."
                        fi      
                done
                if [ $STOP -eq 0 ]
                then    
                        echo " failed. $HOST not responding."
                fi
        else
                echo "$DIR already mounted"
        fi
done

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1118447

Title:
  Race condition with network and NFS mounts causes boottime hang

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1118447/+subscriptions

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to