# Global variables
# Some scripts to be called
-SCRIPTS_PATH=$"./"
+SCRIPTS_PATH=${CLUSTER_SCRIPTS_PATH:-"./"}
MODULE_CONFIG=${SCRIPTS_PATH}$"module_config.sh"
VERIFY_CLUSTER_NET=${SCRIPTS_PATH}$"verify_cluster_net.sh"
GEN_HB_CONFIG=${SCRIPTS_PATH}$"gen_hb_config.sh"
# Here we expect the csv file
if [ $# -eq 0 ]; then
- echo >&2 $"`basename $0`: Lack csv file!"
+ echo >&2 $"`basename $0`: Missing csv file"
usage
fi
fi
# Execute pdsh command to add lnet options lines to modprobe.conf/modules.conf
- verbose_output "Adding lnet options to ${HOST_NAME}..."
+ verbose_output "Adding module options to ${HOST_NAME}..."
COMMAND=$"echo \"${NETWORKS}\"|${MODULE_CONFIG}"
pdsh -w ${HOST_NAME} ${COMMAND} >&2 &
PDSH_PID[${pid_num}]=$!
HOST_IPADDRS[$2]=`egrep "[[:space:]]$1([[:space:]]|$)" /etc/hosts \
| awk '{print $1}'`
if [ -z "${HOST_IPADDRS[$2]}" ]; then
- echo >&2 "`basename $0`: local_cleck() error: $1 does not" \
+ echo >&2 "`basename $0`: local_check() error: $1 does not" \
"exist in the local /etc/hosts table!"
return 1
fi
if [ ${#HOST_IPADDRS[$2]} -gt 15 ]; then
- echo >&2 "`basename $0`: local_cleck() error: More than one" \
+ echo >&2 "`basename $0`: local_check() error: More than one" \
"IP address line according to $1 in the local" \
"/etc/hosts table!"
return 1
# Execute pdsh command to get the real host name
RET_STR=`pdsh -w ${HOST_IPADDRS[$2]} hostname 2>&1`
if [ $? -ne 0 ] || [ "${RET_STR}" != "${RET_STR#*connect:*}" ]; then
- echo >&2 "`basename $0`: local_cleck() error: pdsh error:" \
+ echo >&2 "`basename $0`: local_check() error: pdsh error:" \
"${RET_STR}"
return 1
fi
if [ -z "${RET_STR}" ]; then
- echo >&2 "`basename $0`: local_cleck() error: pdsh error:" \
- "Nothing get from pdsh! Check the network connectivity"\
+ echo >&2 "`basename $0`: local_check() error: pdsh error:" \
+ "No results from pdsh! Check the network connectivity"\
"between the local host and ${HOST_IPADDRS[$2]}" \
"or check the two hosts' rcmd module!"
return 1
REAL_NAME=`echo ${RET_STR} | awk '{print $2}'`
if [ "$1" != "${REAL_NAME}" ]; then
- echo >&2 "`basename $0`: local_cleck() error: The real hostname"\
+ echo >&2 "`basename $0`: local_check() error: The real hostname"\
"according to ${HOST_IPADDRS[$2]} is ${REAL_NAME}," \
"not $1! Check the local /etc/hosts table!"
return 1