From 28cb65ebacb3026d858f02c73601ece98a2b2d42 Mon Sep 17 00:00:00 2001 From: Victor Hu Date: Mon, 16 Mar 2015 16:59:02 -0400 Subject: [PATCH] rcons automatically uses confluent when it's installed on the xCAT management machine. Tests for /opt/confluent/bin/confetty Change to first check consoleservice keyword in site table before using confluent. This allows us to install confluent on the machine and control use with the keyword --- xCAT-client/bin/rcons | 29 +++++++++++++++++++++-------- 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/xCAT-client/bin/rcons b/xCAT-client/bin/rcons index a2baa3326..a226f3bfc 100755 --- a/xCAT-client/bin/rcons +++ b/xCAT-client/bin/rcons @@ -52,15 +52,28 @@ if [ -n "$2" ]; then fi fi -if [ -x "/opt/confluent/bin/confetty" ] || [ -x "/usr/bin/confetty" ] || [ -x "/usr/local/bin/confetty" ]; then - #use confluent - CONFETTY="confetty" - if [ -x "/opt/confluent/bin/confetty" ]; then +# xCAT 2.9.1 allows for an option to use confluent as a rcons replacement and only use +# confluent if this keyword is defined in the site table. This allows for confluent to +# be installed on the xCAT management node and switch between conserver & confluent +USE_CONFLUENT=0 +CONSOLE_SERVICE_KEYWORD=`tabdump site | grep consoleservice | cut -d, -f1 | tr -d '"'` +CONSOLE_SERVICE_VALUE=`tabdump site | grep consoleservice | cut -d, -f2 | tr -d '"'` + +if [ $CONSOLE_SERVICE_KEYWORD == "consoleservice" ]; then + if [ $CONSOLE_SERVICE_VALUE == "confluent" ]; then + USE_CONFLUENT=1 + fi +fi + +if [ $USE_CONFLUENT == "1" ] && ([ -x "/opt/confluent/bin/confetty" ] || [ -x "/usr/bin/confetty" ] || [ -x "/usr/local/bin/confetty" ]); then + #use confluent + CONFETTY="confetty" + if [ -x "/opt/confluent/bin/confetty" ]; then CONFETTY="/opt/confluent/bin/confetty" - fi - if [ ! -z "$CONSCONTROLPATH" ]; then - CONSCONTROLPATH="-c $CONSCONTROLPATH" - fi + fi + if [ ! -z "$CONSCONTROLPATH" ]; then + CONSCONTROLPATH="-c $CONSCONTROLPATH" + fi if [ -z "$CONSERVER" ]; then CONSERVER=`nodels $1 nodehm.conserver 2>/dev/null | awk -F: '{print $2}' | tr -d ' '` fi