1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-26 21:57:41 +03:00

eventscripts: New configuration variable $CTDB_RPCINFO_LOCALHOST

Passing "localhost" to the rpcinfo command causes overheads, like
reading /etc/services multiple times.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Pair-programmed-with: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit 1d61988af9e4fa3621a3e2d06a859bcb53df2d67)
This commit is contained in:
Martin Schwenke 2013-08-05 15:12:14 +10:00 committed by Amitay Isaacs
parent 0ca046577f
commit b1f7337d2b
2 changed files with 8 additions and 1 deletions

View File

@ -148,6 +148,11 @@ CTDB_RECOVERY_LOCK="/some/place/on/shared/storage"
# dump no stack traces.
# CTDB_NFS_DUMP_STUCK_THREADS=5
# Host to use for rpcinfo checks. Using "localhost" causes
# /etc/services to be read serveral times by rpcinfo, so this allows
# optimisation.
CTDB_RPCINFO_LOCALHOST="127.0.0.1"
# When set to yes, the CTDB node will start in DISABLED mode and not host
# any public ip addresses. The administrator needs to explicitely enable
# the node with "ctdb enable"

View File

@ -408,7 +408,9 @@ ctdb_check_rpc ()
progname="$1"
version="$2"
if ! ctdb_check_rpc_out=$(rpcinfo -u localhost $progname $version 2>&1) ; then
_localhost="${CTDB_RPCINFO_LOCALHOST:-127.0.0.1}"
if ! ctdb_check_rpc_out=$(rpcinfo -u $_localhost $progname $version 2>&1) ; then
ctdb_check_rpc_out="ERROR: $progname failed RPC check:
$ctdb_check_rpc_out"
echo "$ctdb_check_rpc_out"