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 mkdir
-p /var
/lock
/subsys
13 mkdir
-p /run
/nfs
/sm.bak
16 CFG_FILE
=/etc
/default
/nfsd
19 if [ -f "${CFG_FILE}" ]; then
26 printf "Starting NFS statd: "
28 [ $?
= 0 ] && echo "OK" ||
echo "FAIL"
29 touch /var
/lock
/subsys
/nfslock
31 printf "Starting NFS services: "
33 [ $?
= 0 ] && echo "OK" ||
echo "FAIL"
35 printf "Starting NFS daemon: "
36 rpc.nfsd
${NR_THREADS}
37 [ $?
= 0 ] && echo "OK" ||
echo "FAIL"
39 printf "Starting NFS mountd: "
41 [ $?
= 0 ] && echo "OK" ||
echo "FAIL"
42 touch /var
/lock
/subsys
/nfs
47 printf "Shutting down NFS mountd: "
48 killall
-q rpc.mountd
2>/dev
/null
49 [ $?
= 0 ] && echo "OK" ||
echo "FAIL"
51 printf "Shutting down NFS daemon: "
52 killall
-q nfsd
2>/dev
/null
53 [ $?
= 0 ] && echo "OK" ||
echo "FAIL"
55 printf "Shutting down NFS services: "
56 /usr
/sbin
/exportfs
-au
57 [ $?
= 0 ] && echo "OK" ||
echo "FAIL"
59 printf "Stopping NFS statd: "
60 killall
-q rpc.statd
2>/dev
/null
61 [ $?
= 0 ] && echo "OK" ||
echo "FAIL"
62 rm -f /var
/lock
/subsys
/nfs
63 rm -f /var
/run
/rpc.statd.pid
64 rm -f /var
/lock
/subsys
/nfslock
67 # See how we were called.
81 touch /var
/lock
/subsys
/nfs
84 echo "Usage: $0 {start|stop|restart|reload}"