Fix usage of rpcinfo being available inside /usr/sbin nowadays [Closes: issue1274]
authorMichael Prokop <mika@grml.org>
Fri, 13 Sep 2013 10:44:13 +0000 (12:44 +0200)
committerMichael Prokop <mika@grml.org>
Fri, 13 Sep 2013 10:44:13 +0000 (12:44 +0200)
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

index 253514a..a2e31d2 100755 (executable)
@@ -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