]> git.decadent.org.uk Git - nfs-utils.git/blobdiff - debian/nfs-common.init
Use kernel version to short-circuit the lockd test in nfs-common.init.
[nfs-utils.git] / debian / nfs-common.init
index f6c4a8ad2a3bad07c8019c0b6f7534a440c4f45a..59fc59df6fecad7429ec9b24a762a5b72675630e 100755 (executable)
@@ -22,16 +22,25 @@ if [ -f $DEFAULTFILE ]; then
     . $DEFAULTFILE
 fi
 
-# Determine whether lockd is required
+# Determine whether lockd daemon is required.
 case "$NEED_LOCKD" in
 yes|no)        ;;
-*)  # We must be conservative and run lockd,
-    #  unless we can prove that it's not required.
-    NEED_LOCKD=yes
-    if test -f /proc/ksyms
-    then
-       grep -q lockdctl /proc/ksyms || NEED_LOCKD=no
-    fi
+*)  case `uname -r` in
+    '' | [01].* | 2.[0123].* )
+       # Older kernels may or may not need a lockd daemon.
+       # We must assume they do, unless we can prove otherwise.
+       # (A false positive here results only in a harmless message.)
+       NEED_LOCKD=yes
+       if test -f /proc/ksyms
+       then
+           grep -q lockdctl /proc/ksyms || NEED_LOCKD=no
+       fi
+       ;;
+
+    *)  # Modern kernels (>= 2.4) start a lockd thread automatically.
+       NEED_LOCKD=no
+       ;;
+    esac
     ;;
 esac