--- /usr/portage/net-fs/nfs-utils/files/nfs-2 2003-07-19 21:29:52.000000000 +0200 +++ /etc/init.d/nfs 2003-07-23 11:53:15.000000000 +0200 @@ -54,6 +54,7 @@ start() { start_statd + # Exportfs likes to hang if networking isn't working. # If that's the case, then try to kill it so the @@ -85,9 +86,37 @@ start-stop-daemon --start --quiet --exec \ $mountd -- $RPCMOUNTDOPTS 1>&2 eend $? "Error starting NFS mountd" + + # post-2.4 nfs features + if [ "$(get_KV)" -ge "$(KV_to_int '2.5.0')" ]; then + ebegin "Starting kernel 2.6 NFS features" + if [ -e /var/lib/rpc_pipes ]; then + mount -trpc_pipefs none /var/lib/rpc_pipes + fi + mount -tnfsd none /proc/fs/nfs + ebegin "Starting idmapd" + start-stop-daemon --start --quiet --exec \ + /usr/bin/idmapd -- -p /var/lib/rpc_pipes/nfs 1>&2 + eend $? "Error starting idmapd" + eend $? "Error starting kernel 2.6 NFS features" + fi } stop() { + # post-2.4 nfs features + if [ "$(get_KV)" -ge "$(KV_to_int '2.5.0')" ]; then + ebegin "Stopping kernel 2.6 NFS features" + ebegin "Stopping idmapd" + start-stop-daemon --stop --quiet --exec \ + /usr/bin/idmapd 1>&2 + eend $? "Error stopping idmapd" + if [ -e /var/lib/rpc_pipes ]; then + umount /var/lib/rpc_pipes + fi + umount /proc/fs/nfs + eend $? "Error stopping kernel 2.6 NFS features" + fi + # Don't check NFSSERVER variable since it might have changed, # instead use --oknodo to smooth things over ebegin "Stopping NFS mountd"