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 if [ "$(kernelverser)" -ge "002006" ]; then
43 grep -q rpc_pipefs /proc/filesystems && \
44 ! grep -q rpc_pipefs /proc/mounts && \
45 run_cmd "Mounting /var/lib/nfs/rpc_pipefs filesystem" mount -t rpc_pipefs rpc_pipefs /var/lib/nfs/rpc_pipefs
47 if [ ! -f /var/lock/subsys/idmapd ]; then
48 msg_starting "NFS idmapd"
49 daemon rpc.idmapd $RPCIDMAPOPTIONS
51 msg_starting "NFS gssd"
52 daemon rpc.gssd -m $RPCGSSOPTIONS
54 run_cmd "Mounting NFS filesystems" mount -a -t nfs
55 touch /var/lock/subsys/nfsfs
57 msg_already_running "NFSFS"
61 if [ -f /proc/mounts ]; then
67 show "Unmounting NFS filesystems"
70 remaining=$(awk '$3 == "nfs" {print $2}' $fsfile)
71 while [ -n "$remaining" -a $retry -gt 0 ]; do
72 fuser -msk -TERM `awk '$3 == "nfs" {print $2}' < $fsfile`
74 fuser -msk -KILL `awk '$3 == "nfs" {print $2}' < $fsfile`
76 remaining=$(awk '$3 == "nfs" {print $2}' $fsfile)
80 if [ "$NFSDTYPE" != "U" ] && grep -q nfs4 /proc/filesystems; then
81 msg_stopping "NFS gssd"
83 if [ -f /var/lock/subsys/idmapd -a ! -f /var/lock/subsys/nfs ]; then
84 msg_stopping "NFS idmapd"
86 rm -f /var/lock/subsys/idmapd
89 rm -f /var/lock/subsys/nfsfs
92 if [ -f /proc/mounts ]; then
93 echo "Configured NFS mountpoints:"
94 grep -v '^#' /etc/fstab | \
95 awk '{ if ($3 ~ /^nfs$/ && $4 !~ /noauto/) print $2}'
96 echo "Active NFS mountpoints:"
97 grep -v '^#' /proc/mounts | \
98 awk '{ if ($3 ~ /^nfs$/ && $4 !~ /noauto/) print $2}'
100 echo "/proc filesystem unavailable"
111 msg_usage "$0 {start|stop|restart|reload|force-reload|status}"