summaryrefslogtreecommitdiff
path: root/ctdb
diff options
context:
space:
mode:
authorMartin Schwenke <martin@meltin.net>2015-06-19 16:54:33 +1000
committerAmitay Isaacs <amitay@samba.org>2015-07-14 09:57:18 +0200
commit49c4d1900cb6daae0b1eb822663f211726f88bcc (patch)
tree988ba1d6efe2e573055fd08d2795632bd1207787 /ctdb
parent74428e5c1463d6c60880ba593c880bc36a8f1ff4 (diff)
downloadsamba-49c4d1900cb6daae0b1eb822663f211726f88bcc.tar.gz
ctdb-scripts: Remove old NFS checking code
Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Diffstat (limited to 'ctdb')
-rwxr-xr-xctdb/config/functions210
-rw-r--r--ctdb/config/nfs-rpc-checks.d/10.statd.check2
-rw-r--r--ctdb/config/nfs-rpc-checks.d/20.nfsd.check2
-rw-r--r--ctdb/config/nfs-rpc-checks.d/30.lockd.check2
-rw-r--r--ctdb/config/nfs-rpc-checks.d/40.mountd.check2
-rw-r--r--ctdb/config/nfs-rpc-checks.d/50.rquotad.check2
l---------ctdb/tests/eventscripts/etc-ctdb/nfs-rpc-checks.d1
7 files changed, 0 insertions, 221 deletions
diff --git a/ctdb/config/functions b/ctdb/config/functions
index 4290bfa841f..1b79585daa6 100755
--- a/ctdb/config/functions
+++ b/ctdb/config/functions
@@ -259,216 +259,6 @@ program_stack_traces ()
}
######################################################
-# Check that an RPC service is healthy -
-# this includes allowing a certain number of failures
-# before marking the NFS service unhealthy.
-#
-# usage: nfs_check_rpc_service SERVICE_NAME [ triple ...]
-#
-# each triple is a set of 3 arguments: an operator, a
-# fail count limit and an action string.
-#
-# For example:
-#
-# nfs_check_rpc_service "lockd" \
-# -ge 15 "verbose restart unhealthy" \
-# -eq 10 "restart:bs"
-#
-# says that if lockd is down for 15 iterations then do
-# a verbose restart of lockd and mark the node unhealthy.
-# Before this, after 10 iterations of failure, the
-# service is restarted silently in the background.
-# Order is important: the number of failures need to be
-# specified in reverse order because processing stops
-# after the first condition that is true.
-######################################################
-nfs_check_rpc_service ()
-{
- _prog_name="$1" ; shift
-
- if _nfs_check_rpc_common "$_prog_name" ; then
- return
- fi
-
- while [ -n "$3" ] ; do
- if _nfs_check_rpc_action "$1" "$2" "$3" ; then
- break
- fi
- shift 3
- done
-}
-
-# The new way of doing things...
-nfs_check_rpc_services ()
-{
- # Files must end with .check - avoids editor backups, RPM fu, ...
- for _f in "${CTDB_BASE}/nfs-rpc-checks.d/"[0-9][0-9].*.check ; do
- _t="${_f%.check}"
- _prog_name="${_t##*/[0-9][0-9].}"
-
- # If $_prog_name contains '@' then the bit after it is the
- # address family.
- _family="${_prog_name#*@}"
- if [ "$_family" = "$_prog_name" ] ; then
- _family=""
- else
- _prog_name="${_prog_name%@*}"
- fi
-
- if _nfs_check_rpc_common "$_prog_name" "$_family" ; then
- # This RPC service is up, check next service...
- continue
- fi
-
- # Check each line in the file in turn until one of the limit
- # checks is hit...
- while read _cmp _lim _rest ; do
- # Skip comments
- case "$_cmp" in
- \#*) continue ;;
- esac
-
- if _nfs_check_rpc_action "$_cmp" "$_lim" "$_rest" ; then
- # Limit was hit on this line, no further checking...
- break
- fi
- done <"$_f"
- done
-}
-
-_nfs_check_rpc_common ()
-{
- _prog_name="$1"
- _family="$2"
-
- # Some platforms don't have separate programs for all services.
- case "$_prog_name" in
- statd)
- type "rpc.${_prog_name}" >/dev/null 2>&1 || return 0
- esac
-
- case "$_prog_name" in
- nfsd)
- _rpc_prog=nfs
- _version=3
- ;;
- mountd)
- _rpc_prog=mountd
- _version=1
- ;;
- rquotad)
- _rpc_prog=rquotad
- _version=1
- ;;
- lockd)
- _rpc_prog=nlockmgr
- _version=4
- ;;
- statd)
- _rpc_prog=status
- _version=1
- ;;
- *)
- echo "Internal error: unknown RPC program \"$_prog_name\"."
- exit 1
- esac
-
- _service_name="nfs_${_prog_name}${_family:+_}${_family}"
-
- if ctdb_check_rpc "$_rpc_prog" "$_version" "$_family" >/dev/null ; then
- ctdb_counter_init "$_service_name"
- return 0
- fi
-
- ctdb_counter_incr "$_service_name"
-
- return 1
-}
-
-_nfs_check_rpc_action ()
-{
- _cmp="$1"
- _limit="$2"
- _actions="$3"
-
- if ctdb_check_counter "quiet" "$_cmp" "$_limit" "$_service_name" ; then
- return 1
- fi
-
- for _action in $_actions ; do
- case "$_action" in
- verbose)
- echo "ERROR: $ctdb_check_rpc_out"
- ;;
- restart)
- _nfs_restart_rpc_service "$_prog_name"
- ;;
- restart:b)
- _nfs_restart_rpc_service "$_prog_name" true
- ;;
- unhealthy)
- exit 1
- ;;
- *)
- echo "Internal error: unknown action \"$_action\"."
- exit 1
- esac
- done
-
- return 0
-}
-
-_nfs_restart_rpc_service ()
-{
- _prog_name="$1"
- _background="${2:-false}"
-
- if $_background ; then
- _maybe_background="background_with_logging"
- else
- _maybe_background=""
- fi
-
- _p="rpc.${_prog_name}"
-
- case "$_prog_name" in
- nfsd)
- echo "Trying to restart NFS service"
- $_maybe_background startstop_nfs restart
- ;;
- mountd)
- echo "Trying to restart $_prog_name [${_p}]"
- killall -q -9 "$_p"
- nfs_dump_some_threads "$_p"
- $_maybe_background $_p $RPCMOUNTDOPTS \
- ${MOUNTD_PORT:+-p} $MOUNTD_PORT
- ;;
- rquotad)
- echo "Trying to restart $_prog_name [${_p}]"
- killall -q -9 "$_p"
- nfs_dump_some_threads "$_p"
- $_maybe_background $_p ${RQUOTAD_PORT:+-p} $RQUOTAD_PORT
- ;;
- lockd)
- echo "Trying to restart lock manager service"
- $_maybe_background startstop_nfslock restart
- ;;
- statd)
- echo "Trying to restart $_prog_name [${_p}]"
- killall -q -9 "$_p"
- nfs_dump_some_threads "$_p"
- $_maybe_background $_p \
- ${STATD_HOSTNAME:+-n} $STATD_HOSTNAME \
- ${STATD_PORT:+-p} $STATD_PORT \
- ${STATD_OUTGOING_PORT:+-o} $STATD_OUTGOING_PORT
- ;;
- *)
- echo "Internal error: unknown RPC program \"$_prog_name\"."
- exit 1
- esac
-}
-
-######################################################
# Check the health of NFS services
#
# Use .check files in given directory.
diff --git a/ctdb/config/nfs-rpc-checks.d/10.statd.check b/ctdb/config/nfs-rpc-checks.d/10.statd.check
deleted file mode 100644
index fd7a864aa3a..00000000000
--- a/ctdb/config/nfs-rpc-checks.d/10.statd.check
+++ /dev/null
@@ -1,2 +0,0 @@
--ge 6 verbose restart:b unhealthy
-% 2 verbose restart:b
diff --git a/ctdb/config/nfs-rpc-checks.d/20.nfsd.check b/ctdb/config/nfs-rpc-checks.d/20.nfsd.check
deleted file mode 100644
index aa4a2e709ca..00000000000
--- a/ctdb/config/nfs-rpc-checks.d/20.nfsd.check
+++ /dev/null
@@ -1,2 +0,0 @@
-% 10 verbose restart:b unhealthy
--ge 2 verbose unhealthy
diff --git a/ctdb/config/nfs-rpc-checks.d/30.lockd.check b/ctdb/config/nfs-rpc-checks.d/30.lockd.check
deleted file mode 100644
index fd7a864aa3a..00000000000
--- a/ctdb/config/nfs-rpc-checks.d/30.lockd.check
+++ /dev/null
@@ -1,2 +0,0 @@
--ge 6 verbose restart:b unhealthy
-% 2 verbose restart:b
diff --git a/ctdb/config/nfs-rpc-checks.d/40.mountd.check b/ctdb/config/nfs-rpc-checks.d/40.mountd.check
deleted file mode 100644
index fd7a864aa3a..00000000000
--- a/ctdb/config/nfs-rpc-checks.d/40.mountd.check
+++ /dev/null
@@ -1,2 +0,0 @@
--ge 6 verbose restart:b unhealthy
-% 2 verbose restart:b
diff --git a/ctdb/config/nfs-rpc-checks.d/50.rquotad.check b/ctdb/config/nfs-rpc-checks.d/50.rquotad.check
deleted file mode 100644
index fd7a864aa3a..00000000000
--- a/ctdb/config/nfs-rpc-checks.d/50.rquotad.check
+++ /dev/null
@@ -1,2 +0,0 @@
--ge 6 verbose restart:b unhealthy
-% 2 verbose restart:b
diff --git a/ctdb/tests/eventscripts/etc-ctdb/nfs-rpc-checks.d b/ctdb/tests/eventscripts/etc-ctdb/nfs-rpc-checks.d
deleted file mode 120000
index 991b966b114..00000000000
--- a/ctdb/tests/eventscripts/etc-ctdb/nfs-rpc-checks.d
+++ /dev/null
@@ -1 +0,0 @@
-../../../config/nfs-rpc-checks.d \ No newline at end of file