www-client/w3m: remove
[sgilles-overlay.git] / net-fs / nfs-utils / files / nfsmount.initd
blob0577d58e02f971db6f60bba4647ead91286d90de
1 #!/sbin/openrc-run
2 # Copyright 1999-2013 Gentoo Foundation
3 # Distributed under the terms of the GNU General Public License v2
4 # $Id$
6 [ -e /etc/conf.d/nfs ] && . /etc/conf.d/nfs
8 depend() {
9         local myneed=""
10         if [ -e /etc/fstab ] ; then
11                 myneed="${myneed} $(
12                         awk '!/^[[:space:]]*#/ && ($3 == "nfs" || $3 == "nfs4") {
13                                         if ($3 == "nfs4")
14                                                 idmapd = "rpc.idmapd"
15                                         if ($4 ~ /sec=(krb|spkm)/)
16                                                 gssd = "rpc.gssd"
17                                 }
18                                 END { print idmapd " " gssd }
19                                 ' /etc/fstab
20                         )"
21         fi
22         config /etc/fstab
23         need portmap rpc.statd ${myneed}
24         use ypbind dns rpc.idmapd rpc.gssd
27 start() {
28         if [ -x /usr/sbin/sm-notify ] ; then
29                 ebegin "Starting NFS sm-notify"
30                 /usr/sbin/sm-notify ${OPTS_SMNOTIFY}
31                 eend $?
32         fi
34         # Make sure nfs support is loaded in the kernel #64709
35         if [ -e /proc/modules ] && ! grep -qs 'nfs$' /proc/filesystems ; then
36                 modprobe -q nfs
37         fi
39         ebegin "Mounting NFS filesystems"
40         mount -a -t nfs,nfs4
41         eend $?
44 stop() {
45         ebegin "Unmounting NFS filesystems"
46         umount -a -t nfs,nfs4
47         eend $?