### BEGIN INIT INFO
# Provides: nfs-common
-# Required-Start: $time
+# Required-Start: $portmap $time
# Required-Stop: $time
-# Default-Start: 2 3 4 5
+# Default-Start: 2 3 4 5 S
# Default-Stop: 0 1 6
# Short-Description: NFS support files common to client and server
# Description: NFS is a popular protocol for file sharing across
# condition in nfs-kernel-server's init script does, which has a value in
# itself.
#
-if [ -f /etc/exports ]; then
+if [ -f /etc/exports ] && grep -q '^ .*/' /etc/exports; then
AUTO_NEED_IDMAPD=yes
fi
;;
esac
-# Exit if required binaries are missing.
-[ -x $PREFIX/sbin/rpc.statd ] || exit 0
-[ -x /usr/sbin/rpc.idmapd ] || [ "$NEED_IDMAPD" = no ] || exit 0
-[ -x /usr/sbin/rpc.gssd ] || [ "$NEED_GSSD" = no ] || exit 0
-
do_modprobe() {
if [ -x /sbin/modprobe -a -f /proc/modules ]
then
exit $?
fi
+ # Don't start idmapd and gssd if we don't have them (say, if /usr is not
+ # up yet).
+ [ -x /usr/sbin/rpc.idmapd ] || NEED_IDMAPD=no
+ [ -x /usr/sbin/rpc.gssd ] || NEED_GSSD=no
+
if [ "$NEED_IDMAPD" = yes ] || [ "$NEED_GSSD" = yes ]
then
do_modprobe nfs