3 # nfs This shell script takes care of starting and stopping
4 # the NFS services. Later we might add NIS too.
7 # description: NFS is a popular protocol for file sharing across TCP/IP \
8 # networks. This service provides NFS server functionality, \
9 # which is configured via the /etc/exports file.
13 # Source function library
14 . /etc/rc.d/init.d/functions
17 . /etc/sysconfig/network
20 [ -f /etc/sysconfig/nfs ] && . /etc/sysconfig/nfs
22 # Check that networking is up.
23 if [ "${NETWORKING}" = "no" ]; then
24 echo "WARNING: Networking is down. Nfs service can't be runed."
29 [ -f /etc/exports ] || exit 0
32 # See how we were called.
35 # Check if the service is already running?
36 if [ ! -f /var/lock/subsys/nfs ]; then
37 show Starting rpc.mountd
39 show Starting rpc.nfsd
42 echo "nfs already is running"
44 touch /var/lock/subsys/nfs
48 show Shutting down rpc.mountd
50 show Shutting down rpc.nfsd
52 rm -f /var/lock/subsys/nfs
63 echo "Usage: $0 {start|stop|status|restart}"