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 touch /var
/lib
/nfs
/etab
20 touch /var
/lib
/nfs
/rmtab
21 touch /var
/lib
/nfs
/state
22 touch /var
/lib
/nfs
/xtab
26 echo -n "Starting NFS statd: "
28 touch /var
/lock
/subsys
/nfslock
31 echo -n "Starting NFS services: "
36 echo -n "Starting NFS daemon: "
40 echo -n "Starting NFS mountd: "
43 touch /var
/lock
/subsys
/nfs
48 echo -n "Shutting down NFS mountd: "
52 echo "Shutting down NFS daemon: "
53 kill -9 `pidof nfsd` 2>/dev
/null
56 echo -n "Shutting down NFS services: "
57 /usr
/sbin
/exportfs
-au
58 rm -f /var
/lock
/subsys
/nfs
62 echo -n "Stopping NFS statd: "
65 rm -f /var
/lock
/subsys
/nfslock
68 # See how we were called.
82 touch /var
/lock
/subsys
/nfs
85 echo "Usage: nfs {start|stop|reload}"