3 # nfs This shell script takes care of starting and stopping
4 # the NFS services. Stolen from RedHat FC5.
6 [ -x /usr/sbin/rpc.statd ] || exit 0
7 [ -x /usr/sbin/rpc.nfsd ] || exit 0
8 [ -x /usr/sbin/rpc.mountd ] || exit 0
9 [ -x /usr/sbin/exportfs ] || exit 0
11 # Don't fail if /etc/exports doesn't exist; create a bare-bones version and continue.
12 [ -r /etc/exports ] || \
13 { touch /etc/exports && chmod u+rw,g+r,o+r /etc/exports ; } || \
14 { echo "/etc/exports does not exist" ; exit 0 ; }
16 # The /var/lib/nfs directory is actually on a tmpfs filesystem.
17 mkdir -p /var/lib/nfs/sm
18 mkdir -p /var/lib/nfs/sm.bak
19 mkdir -p /var/lock/subsys
20 touch /var/lib/nfs/etab
21 touch /var/lib/nfs/rmtab
22 touch /var/lib/nfs/state
23 touch /var/lib/nfs/xtab
27 echo -n "Starting NFS statd: "
29 touch /var/lock/subsys/nfslock
32 echo -n "Starting NFS services: "
37 echo -n "Starting NFS daemon: "
41 echo -n "Starting NFS mountd: "
44 touch /var/lock/subsys/nfs
49 echo -n "Shutting down NFS mountd: "
53 echo "Shutting down NFS daemon: "
54 kill -9 `pidof nfsd` 2>/dev/null
57 echo -n "Shutting down NFS services: "
58 /usr/sbin/exportfs -au
59 rm -f /var/lock/subsys/nfs
63 echo -n "Stopping NFS statd: "
66 rm -f /var/lock/subsys/nfslock
69 # See how we were called.
83 touch /var/lock/subsys/nfs
86 echo "Usage: nfs {start|stop|reload}"