[Pkg-sysvinit-devel] Bug#482176: Solution for NFS mount at boot

Oliver Geisen oliver.geisen at kreisbote.de
Fri May 7 10:00:15 UTC 2010

Just replace the later part of /etc/network/if-up.d/mountnfs with the 
following code:

# Using 'no !=' instead of 'yes =' to make sure async nfs mounting is
# the default even without a value in /etc/default/rcS
if [ no != "$ASYNCMOUNTNFS" ]; then
     # Not for loopback!
     [ "$IFACE" != "lo" ] || exit 0

     # Lock around this otherwise insanity may occur
     mkdir /var/run/network          2>/dev/null || true

     if [ -f /var/run/network/mountnfs ]; then
         msg="if-up.d/mountnfs[$IFACE]: lock /var/run/network/mountnfs 
exist, not mounting"
         log_failure_msg "$msg"
         # Log if /usr/ is mounted
         [ -x /usr/bin/logger ] && /usr/bin/logger -t 
"if-up.d/mountnfs[$IFACE]" "$msg"
         exit 0

     touch /var/run/network/mountnfs

     on_exit() {
         # Clean up lock when script exits, even if it is interrupted
         rm -f /var/run/network/mountnfs 2>/dev/null || exit 0
     trap on_exit EXIT # Enable emergency handler
elif [ yes = "$FROMINITD" ] ; then

This will use a file instead of a directory to lock the action and files 
would be cleaned up on boot.

More information about the Pkg-sysvinit-devel mailing list