3 # nfslock This shell script takes care of starting and stopping
4 # the NFS file locking service.
7 # description: NFS is a popular protocol for file sharing across \
8 # TCP/IP networks. This service provides NFS file \
9 # locking functionality.
12 # Source function library.
13 . /etc/rc.d/init.d/functions
15 # Source networking configuration.
16 if [ ! -f /etc/sysconfig/network ]; then
20 . /etc/sysconfig/network
22 # Check that networking is up.
23 [ ${NETWORKING} = "no" ] && exit 0
25 [ -x /usr/sbin/rpc.lockd ] || exit 0
26 [ -x /usr/sbin/rpc.statd ] || exit 0
28 # See how we were called.
32 echo "Starting NFS file locking services: "
33 echo -n "Starting NFS lockd: "
36 echo -n "Starting NFS statd: "
39 touch /var/lock/subsys/nfslock
43 echo "Shutting down NFS file locking services: "
44 echo -n "Shutting down NFS lockd: "
47 echo -n "Shutting down NFS statd: "
50 rm -f /var/lock/subsys/nfslock
57 echo -n "Restarting NFS file locking services: "
64 touch /var/lock/subsys/nfslock
68 if [ ! -f /var/lock/subsys/nfslock ] ; then
71 /sbin/pidof rpc.statd >/dev/null 2>&1; STATD="$?"
72 /sbin/pidof lockd >/dev/null 2>&1; LOCKD="$?"
73 if [ $STATD = 1 -o $LOCKD = 1 ] ; then
78 echo "Usage: nfslock {start|stop|status|restart}"