ctdb-scripts: Cleanup service_check() in nfs-ganesha-callout
authorJose A. Rivera <jarrpa@samba.org>
Tue, 10 May 2016 14:27:43 +0000 (16:27 +0200)
committerMartin Schwenke <martins@samba.org>
Fri, 13 May 2016 21:37:25 +0000 (23:37 +0200)
Signed-off-by: Jose A. Rivera <jarrpa@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
ctdb/doc/examples/nfs-ganesha-callout

index 634b673b85e513c56ccffd197610b30b6345ea9b..633667a08ab82691ee7243c46171e84b5c3bb3a6 100755 (executable)
@@ -128,7 +128,6 @@ service_start ()
 # Nitty gritty - monitoring and IP handling
 
 GANRECDIR="/var/lib/nfs/ganesha"
-GANRECDIR3="/var/lib/nfs/ganesha_local"
 
 # Return 'active' if the shared filesystem is accessible.
 get_cluster_fs_state ()
@@ -167,8 +166,6 @@ create_ganesha_recdirs ()
     if [ ! -e "$GANRECDIR" ]; then
         ln -sv "$_link_dst" "$GANRECDIR"
     fi
-
-    mkdir -p "$GANRECDIR3"
 }
 
 service_check ()
@@ -190,26 +187,6 @@ service_check ()
        return 1
     fi
 
-    # Check red conditions against limit
-    _reds_max=2
-    _reds=$(ls $GANRECDIR3 | grep -c "red")
-
-    if [ $_reds -ge $_reds_max ] ; then
-       echo "Too many red conditions (${_reds}/${_reds_max})"
-       return 1
-    fi
-
-    # Check for stall
-    _stall_max=120
-    _now=$(date +"%s")
-    _last=$(ls -t $GANRECDIR3 | sed -n -e '1s@_.*@@p')
-    [ -n $_last ] || _last=$_now  # Handle startup
-    _stall=$(($_now - $_last))
-    if [ $_stall -ge $_stall_max ] ; then
-       echo "ERROR: Stalled for ${_stall} second(s)"
-       return 1
-    fi
-
     return 0
 }