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
16 . /etc/sysconfig/network
19 [ -f /etc/sysconfig/nfslock ] && . /etc/sysconfig/nfslock
21 # Check that networking is up.
22 if [ "${NETWORKING}" = "no" ]; then
23 echo "WARNING: Networking is down. NFS lockd and statd can't be run"
27 if [ -x /sbin/pidof ] && [ "$1" != "stop" ]; then
28 [ -z "`/sbin/pidof portmap`" ] && echo "Error: portmap isn't running" && exit 0
32 [ -x /usr/sbin/rpc.lockd ] || exit 0
33 [ -x /usr/sbin/rpc.statd ] || exit 0
35 # See how we were called.
39 show "Starting NFS lockd"
41 show "Starting NFS statd"
43 touch /var/lock/subsys/nfslock
47 show "Shutting down NFS lockd"
49 show "Shutting down NFS statd"
51 rm -f /var/lock/subsys/nfslock
62 if [ ! -f /var/lock/subsys/nfslock ] ; then
65 /sbin/pidof rpc.statd >/dev/null 2>&1; STATD="$?"
66 /sbin/pidof lockd >/dev/null 2>&1; LOCKD="$?"
67 if [ $STATD = 1 -o $LOCKD = 1 ] ; then
72 echo "Usage: nfslock {start|stop|status|restart}"