]> git.pld-linux.org Git - packages/nfs-utils.git/blobdiff - nfslock.init
- autoconf
[packages/nfs-utils.git] / nfslock.init
index 49c9d6e77661f7cc16789932c99eea10ae65b83c..063633466f15262f76d2825fe9a5acd086f1957e 100644 (file)
@@ -1,12 +1,14 @@
 #!/bin/sh
 #
 # nfslock      This shell script takes care of starting and stopping
-#              the NFS file locking service.
+#              the NSM status monitor - rpc.statd
 #
-# chkconfig:   345 14 81
-# description: NFS is a popular protocol for file sharing across \
-#              TCP/IP networks. This service provides NFS file \
-#              locking functionality.
+# chkconfig:   345 14 82
+# description: The rpc.statd server implements the NSM \
+#              (Network  Status  Monitor) RPC protocol. \
+#              It is used by the NFS file locking service, lockd \
+#              to implement lock recovery when the NFS server \
+#              machine crashes and reboots.
 # probe:       true
 
 # Source function library.
 # Check that networking is up.
 if is_yes "${NETWORKING}"; then
        if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then
-               msg_network_down "NFS lockd"
+               msg_network_down "RPC statd"
                exit 1
        fi
 else
        exit 0
 fi
 
-if [ -x /sbin/pidof ] && [ "$1" != "stop" ]; then
-       [ -z "`/sbin/pidof portmap`" ] && nls "Error: portmap isn't running" && exit 0
+if [ "$1" != "stop" ]; then
+       check_portmapper || { nls "Error: portmap isn't running" && exit 0; }
 fi
 
 # /usr may be on NFS, fail silently, nfsfs will start it
@@ -50,16 +52,13 @@ start() {
                [ -n "$STATD_OUTPORT" ] && STATDOPTS="$STATDOPTS -o $STATD_OUTPORT"
 
                # Start daemons.
-               if is_yes "$NFSv2" || is_yes "$NFSv3" ; then
-                       msg_starting "NFS statd"
-                       daemon rpc.statd $STATDOPTS
-                       RETVAL=$?
-                       [ $RETVAL -eq 0 ] && touch /var/lock/subsys/nfslock
-               else
-                       touch /var/lock/subsys/nfslock
-               fi
+               # Don't put sm-notify here, statd will run it when started
+               msg_starting "RPC statd"
+               daemon rpc.statd $STATDOPTS
+               RETVAL=$?
+               [ $RETVAL -eq 0 ] && touch /var/lock/subsys/nfslock
        else
-               msg_already_running "NFS statd"
+               msg_already_running "RPC statd"
        fi
 }
 
@@ -73,13 +72,11 @@ stop() {
                        /sbin/sysctl -w fs.nfs.nlm_udpport=0 >/dev/null 2>&1
                fi
                # Stop daemons.
-               if is_yes "$NFSv2" || is_yes "$NFSv3" ; then
-                       msg_stopping "NFS statd"
-                       killproc rpc.statd
-               fi
+               msg_stopping "RPC statd"
+               killproc rpc.statd
                rm -f /var/lock/subsys/nfslock
        else
-               msg_not_running "NFS statd"
+               msg_not_running "RPC statd"
        fi
 }
 
@@ -93,13 +90,8 @@ case "$1" in
        stop
        ;;
   status)
-       if is_yes "$NFSv2" || is_yes "$NFSv3" ; then
-               status rpc.statd
-               exit $?
-       else
-               echo "NFSv2 and NFSv3 disabled"
-               exit 0
-       fi
+       status rpc.statd
+       exit $?
        ;;
   restart|force-reload)
        stop
@@ -110,13 +102,9 @@ case "$1" in
                echo start
                exit 0
        fi
-       if is_yes "$NFSv2" || is_yes "$NFSv3" ; then
-               /sbin/pidof rpc.statd >/dev/null 2>&1; STATD="$?"
-               if [ $STATD = 1 ]; then
-                       echo restart
-                       exit 0
-               fi
-       else
+       /sbin/pidof rpc.statd >/dev/null 2>&1; STATD="$?"
+       if [ $STATD = 1 ]; then
+               echo restart
                exit 0
        fi
        ;;
This page took 0.046259 seconds and 4 git commands to generate.