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 [ "${NETWORKING}" = "no" ] && echo "Error: Networking is down"; exit 0
26 [ -f /etc/exports ] || exit 0
29 # See how we were called.
32 # Check if the service is already running?
33 if [ ! -f /var/lock/subsys/nfs ]; then
34 show Starting rpc.mountd
36 show Starting rpc.nfsd
39 echo "nfs already is running"
41 touch /var/lock/subsys/nfs
45 show Shutting down rpc.mountd
47 show Shutting down rpc.nfsd
49 rm -f /var/lock/subsys/nfs
60 echo "Usage: $0 {start|stop|status|restart}"