[Pkg-sysvinit-commits] r1035 - in sysvinit/trunk/debian: . initscripts initscripts/etc/init.d initscripts/etc/network/if-up.d

Petter Reinholdtsen pere at alioth.debian.org
Sun Nov 26 15:47:48 CET 2006


Author: pere
Date: 2006-11-26 15:47:45 +0100 (Sun, 26 Nov 2006)
New Revision: 1035

Modified:
   sysvinit/trunk/debian/changelog
   sysvinit/trunk/debian/initscripts/etc/init.d/mountnfs.sh
   sysvinit/trunk/debian/initscripts/etc/network/if-up.d/mountnfs
   sysvinit/trunk/debian/initscripts/rcS.5
Log:
  * Add boot option ASYNCMOUNTNFS=no to get the old init.d/mountnfs.sh
    behaviour until ifup work properly with / on NFS.  The default is
    'yes' as it has the highest chance of success for non-diskless machines.
    It is also useful for machines with multiple network cards.
    (Closes: #388761, #393532)

Modified: sysvinit/trunk/debian/changelog
===================================================================
--- sysvinit/trunk/debian/changelog	2006-11-25 09:23:43 UTC (rev 1034)
+++ sysvinit/trunk/debian/changelog	2006-11-26 14:47:45 UTC (rev 1035)
@@ -3,6 +3,11 @@
   * Make sure init.d/umountfs umount tmpfs file systems in order of
     decreasing length, to avoid problems on systems with chroots.
     Patch from Peter Rabbitson.  (Closes: #391673)
+  * Add boot option ASYNCMOUNTNFS=no to get the old init.d/mountnfs.sh
+    behaviour until ifup work properly with / on NFS.  The default is
+    'yes' as it has the highest chance of success for non-diskless machines.
+    It is also useful for machines with multiple network cards.
+    (Closes: #388761, #393532)
 
  -- Petter Reinholdtsen <pere at debian.org>  Sat, 25 Nov 2006 10:22:13 +0100
 

Modified: sysvinit/trunk/debian/initscripts/etc/init.d/mountnfs.sh
===================================================================
--- sysvinit/trunk/debian/initscripts/etc/init.d/mountnfs.sh	2006-11-25 09:23:43 UTC (rev 1034)
+++ sysvinit/trunk/debian/initscripts/etc/init.d/mountnfs.sh	2006-11-26 14:47:45 UTC (rev 1035)
@@ -16,7 +16,7 @@
 . /lib/init/vars.sh
 . /lib/lsb/init-functions
 
-do_start() {
+do_wait_async_mount() {
 	[ -f /etc/fstab ] || return
 	#
 	# Read through fstab line by line. If it is NFS, set the flag
@@ -84,7 +84,14 @@
 
 case "$1" in
     start)
-        do_start
+        # 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
+                do_wait_async_mount
+        else
+                FROMINITD=yes /etc/network/if-up.d/mountnfs
+        fi
         ;;
     restart|reload|force-reload)
         echo "Error: argument '$1' not supported" >&2

Modified: sysvinit/trunk/debian/initscripts/etc/network/if-up.d/mountnfs
===================================================================
--- sysvinit/trunk/debian/initscripts/etc/network/if-up.d/mountnfs	2006-11-25 09:23:43 UTC (rev 1034)
+++ sysvinit/trunk/debian/initscripts/etc/network/if-up.d/mountnfs	2006-11-26 14:47:45 UTC (rev 1035)
@@ -126,25 +126,30 @@
 }
 
 
-# Not for loopback!
-[ "$IFACE" != "lo" ] || exit 0
+# 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
+    # Lock around this otherwise insanity may occur
+    mkdir /var/run/network          2>/dev/null || true
 
-if mkdir /var/run/network/mountnfs 2>/dev/null ; then
-    :
-else
-    msg="if-up.d/mountnfs[$IFACE]: lock /var/run/network/mountnfs exist, not mounting"
-    log_failure_msg "$msg"
-    [ -x /usr/bin/logger ] && logger -t "if-up.d/mountnfs[$IFACE]" "$msg"
-    exit 0
+    if mkdir /var/run/network/mountnfs 2>/dev/null ; then
+	:
+    else
+	msg="if-up.d/mountnfs[$IFACE]: lock /var/run/network/mountnfs exist, not mounting"
+	log_failure_msg "$msg"
+	[ -x /usr/bin/logger ] && logger -t "if-up.d/mountnfs[$IFACE]" "$msg"
+	exit 0
+    fi
+
+    on_exit() {
+        # Clean up lock when script exits, even if it is interrupted
+	rmdir /var/run/network/mountnfs 2>/dev/null || exit 0
+    }
+    trap on_exit EXIT # Enable emergency handler
+    do_start
+elif [ yes = "$FROMINITD" ] ; then
+    do_start
 fi
-
-on_exit() {
-    # Clean up lock when script exits, even if it is interrupted
-    rmdir /var/run/network/mountnfs 2>/dev/null || exit 0
-}
-trap on_exit EXIT # Enable emergency handler
-
-do_start

Modified: sysvinit/trunk/debian/initscripts/rcS.5
===================================================================
--- sysvinit/trunk/debian/initscripts/rcS.5	2006-11-25 09:23:43 UTC (rev 1034)
+++ sysvinit/trunk/debian/initscripts/rcS.5	2006-11-26 14:47:45 UTC (rev 1035)
@@ -109,6 +109,13 @@
 The size of the tmpfs can be controlled using TMPFS_SIZE and LOCK_SIZE in
 /etc/defaults/tmpfs.
 
+.IP \fBASYNCMOUNTNFS\fP
+Set this to 'no' to disable asynchronous mounting of network drives
+when the network interfaces are mounted, and instead do it only once when
+the machine boot.  The default is 'yes'.  It is useful to disable this
+on machines with the root file system in NFS until ifup from ifupdown work
+proberly in such setup.
+
 .SH NOTE
 The \fBEDITMOTD\fP variable is no longer used.
 




More information about the Pkg-sysvinit-commits mailing list