3 # nfsfs Mount NFS filesystems.
5 # Version: @(#) /etc/init.d/skeleton 1.01 26-Oct-1993
7 # Author: Miquel van Smoorenburg, <miquels@drinkel.nl.mugnet.org>
10 # description: Mounts and unmounts all Network File System (NFS) \
15 # Source networking configuration.
16 if [ ! -f /etc/sysconfig/network ]; then
20 # Source function library.
21 . /etc/rc.d/init.d/functions
24 . /etc/sysconfig/network
26 # Check that networking is up.
27 if is_yes "${NETWORKING}"; then
28 if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then
29 msg_network_down nfsfs
37 # See how we were called.
40 if [ ! -f /var/lock/subsys/nfsfs ]; then
41 if [ "$NFSDTYPE" != "U" ] && grep -q nfs4 /proc/filesystems; then
42 msg_starting "NFS idmapd"
43 daemon rpc.cidmapd $RPCIDMAPOPTIONS
44 msg_starting "NFS gssd"
45 daemon rpc.gssd $RPCGSSOPTIONS
47 run_cmd "Mounting NFS filesystems" mount -a -t nfs
48 touch /var/lock/subsys/nfsfs
50 msg_already_running "NFSFS"
54 if [ -f /proc/mounts ]; then
60 show "Unmounting NFS filesystems"
63 remaining=$(awk '$3 == "nfs" {print $2}' $fsfile)
64 while [ -n "$remaining" -a $retry -gt 0 ]; do
65 fuser -msk -TERM `awk '$3 == "nfs" {print $2}' < $fsfile`
67 fuser -msk -KILL `awk '$3 == "nfs" {print $2}' < $fsfile`
69 remaining=$(awk '$3 == "nfs" {print $2}' $fsfile)
73 if [ "$NFSDTYPE" != "U" ] && grep -q nfs4 /proc/filesystems; then
74 msg_stopping "NFS gssd"
76 msg_stopping "NFS idmapd"
79 rm -f /var/lock/subsys/nfsfs
82 if [ -f /proc/mounts ]; then
83 echo "Configured NFS mountpoints:"
84 grep -v '^#' /etc/fstab | \
85 awk '{ if ($3 ~ /^nfs$/ && $4 !~ /noauto/) print $2}'
86 echo "Active NFS mountpoints:"
87 grep -v '^#' /proc/mounts | \
88 awk '{ if ($3 ~ /^nfs$/ && $4 !~ /noauto/) print $2}'
90 echo "/proc filesystem unavailable"
101 msg_usage "$0 {start|stop|restart|reload|force-reload|status}"