diff --git a/nfsmount.initd b/nfsclient.initd index 6bb1009..dbe894a 100755 --- a/nfsmount.initd +++ b/nfsclient.initd @@ -8,20 +8,19 @@ depend() { local myneed="" if [ -e /etc/fstab ] ; then - myneed="${myneed} $( - awk '!/^[[:space:]]*#/ && ($3 == "nfs" || $3 == "nfs4") { - if ($3 == "nfs4") - idmapd = "rpc.idmapd" - if ($4 ~ /sec=(krb|spkm)/) - gssd = "rpc.gssd" - } - END { print idmapd " " gssd } - ' /etc/fstab - )" + fstabinfo -t nfs4 -q && myneed="$myneed rpc.idmapd" + fstabinfo -t nfs -q && myneed="$myneed rpc.statd" + fstabinfo -o -t nfs,nfs4 | while read opts; do + case $opts in + *sec=krb*|*sec=spkm*) myneed="$myneed rpc.gssd" ;; + esac + done fi + before netmount config /etc/fstab - need portmap rpc.statd ${myneed} - use ypbind dns rpc.idmapd rpc.gssd + need portmap ${myneed} + provide nfsmount + use ypbind dns } start() { @@ -35,14 +34,5 @@ start() { if [ -e /proc/modules ] && ! grep -qs 'nfs$' /proc/filesystems ; then modprobe -q nfs fi - - ebegin "Mounting NFS filesystems" - mount -a -t nfs,nfs4 - eend $? -} - -stop() { - ebegin "Unmounting NFS filesystems" - umount -a -t nfs,nfs4 - eend $? + return 0 }