From: chip Date: Wed, 29 Oct 2003 21:32:50 +0000 (+0000) Subject: Use kernel version to short-circuit the lockd test in nfs-common.init. X-Git-Tag: nfs-utils-1-0-6-post1~1 X-Git-Url: https://git.decadent.org.uk/gitweb/?a=commitdiff_plain;h=b7f4ad19f9b3b8e0f93da719a86d0e865be5ab75;p=nfs-utils.git Use kernel version to short-circuit the lockd test in nfs-common.init. --- diff --git a/debian/changelog b/debian/changelog index 47210b1..0326c13 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +nfs-utils (1:1.0.6-2) unstable; urgency=low + + * Test kernel version in init script; if kernel is 2.4 or later, + rpc.lockd is unnecessary. Existing tests still apply to earlier + kernels. (closes: #205867) + + -- + nfs-utils (1:1.0.6-1) unstable; urgency=low * New upstream version: diff --git a/debian/nfs-common.init b/debian/nfs-common.init index f6c4a8a..59fc59d 100755 --- a/debian/nfs-common.init +++ b/debian/nfs-common.init @@ -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