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
23 . /etc/sysconfig/network
25 # Check that networking is up.
26 if is_no "${NETWORKING}"; then
27 msg_Network_Down nfsfs
31 CONFIGUREDNFSMOUNTPOINTS="`grep -v '^#' /etc/fstab | \
32 awk '{ if ($3 ~ /^nfs$/ && $4 !~ /noauto/) print $2}'`"
33 ACTIVENFSMOUNTPOINTS="`grep -v '^#' /proc/mounts | \
34 awk '{ if ($3 ~ /^nfs$/ && $4 !~ /noauto/) print $2}'`"
36 # See how we were called.
39 if [ -z "$CONFIGUREDNFSMOUNTPOINTS" ] ; then
40 echo "There are no configured NFS mountpoints!"
42 show "Mounting NFS filesystems"
47 touch /var/lock/subsys/nfsfs
51 if [ -f /proc/mounts ] ; then
57 if [ -z "$CONFIGUREDNFSMOUNTPOINTS" ] ; then
58 echo "There are no configured NFS mountpoints!"
59 elif [ -z "$ACTIVENFSMOUNTPOINTS" ] ; then
60 echo "There are no active NFS mountpoints!"
63 show "Unmounting NFS filesystems"
65 fuser -msk -TERM `awk '$3 == "nfs" {print $2}' < $fsfile`
67 fuser -msk -KILL `awk '$3 == "nfs" {print $2}' < $fsfile`
71 rm -f /var/lock/subsys/nfsfs
75 if [ -f /proc/mounts ] ; then
76 echo "Configured NFS mountpoints:"
77 echo "$CONFIGUREDNFSMOUNTPOINTS"
78 echo "Active NFS mountpoints:"
79 echo "$ACTIVENFSMOUNTPOINTS"
81 echo "/proc filesystem unavailable"
92 msg_Usage "$0 {start|stop|restart|reload|status}"