From 608a4ec394f98c12e0cc5a8f36f80f3bdd5d5190 Mon Sep 17 00:00:00 2001 From: Michael Prokop Date: Fri, 13 Sep 2013 12:44:13 +0200 Subject: [PATCH] Fix usage of rpcinfo being available inside /usr/sbin nowadays [Closes: issue1274] If the call to rpcinfo fails we get "--no-nfs-version 3" appended to the rpc.mountd call, which results in non-booting PXE clients. Thanks: Joe Stingel for the initial bug report --- nfs-kernel-server | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/nfs-kernel-server b/nfs-kernel-server index 253514a..a2e31d2 100755 --- a/nfs-kernel-server +++ b/nfs-kernel-server @@ -89,7 +89,15 @@ case "$1" in } fi - $PREFIX/bin/rpcinfo -u localhost nfs 3 >/dev/null 2>&1 || + if [ -x $PREFIX/bin/rpcinfo ] ; then + RPCINFO=$PREFIX/bin/rpcinfo + elif [ -x $PREFIX/sbin/rpcinfo ] ; then + RPCINFO=$PREFIX/sbin/rpcinfo + else + echo "Error: could not locate rpcinfo binary." >&2 + exit 1 + fi + $RPCINFO -u localhost nfs 3 >/dev/null 2>&1 || RPCMOUNTDOPTS="$RPCMOUNTDOPTS --no-nfs-version 3" [ -z "$ClearAddr" ] || echo "nfsd 127.0.0.1 1" >/proc/net/rpc/auth.unix.ip/channel -- 2.1.4