You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafodion.apache.org by db...@apache.org on 2015/12/22 17:28:39 UTC

[08/13] incubator-trafodion git commit: fixes

fixes


Project: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/commit/cbcde79e
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/tree/cbcde79e
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/diff/cbcde79e

Branch: refs/heads/master
Commit: cbcde79ea87bae975a3a1c18faa17223d80b1a2d
Parents: bc69187
Author: Anuradha Hegde <An...@esgyn.com>
Authored: Wed Dec 16 23:42:33 2015 +0000
Committer: Anuradha Hegde <An...@esgyn.com>
Committed: Wed Dec 16 23:42:33 2015 +0000

----------------------------------------------------------------------
 core/sqf/sql/scripts/cleanlogs |  6 ++++++
 core/sqf/sql/scripts/dcscheck  | 14 +++++++-------
 2 files changed, 13 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/cbcde79e/core/sqf/sql/scripts/cleanlogs
----------------------------------------------------------------------
diff --git a/core/sqf/sql/scripts/cleanlogs b/core/sqf/sql/scripts/cleanlogs
index c4d5123..c903d68 100755
--- a/core/sqf/sql/scripts/cleanlogs
+++ b/core/sqf/sql/scripts/cleanlogs
@@ -39,23 +39,29 @@ function usage() {
 }
 
 function core_logs() {
+ if [[ ! -z $L_PDSH ]]; then
    $L_PDSH rm -f ${MY_SQROOT}/logs/*.err
    $L_PDSH rm -f ${MY_SQROOT}/logs/*.log
    $L_PDSH rm -f ${MY_SQROOT}/logs/*log.[0-9]*
+ fi
 }
 
 function dcs_logs() {
+ if [[ ! -z $L_PDSH ]]; then
    $L_PDSH rm -f ${DCS_INSTALL_DIR}/logs/*.log
    $L_PDSH rm -f ${DCS_INSTALL_DIR}/logs/*.log.[0-9]*
    $L_PDSH rm -f ${DCS_INSTALL_DIR}/logs/*.out
    $L_PDSH rm -f ${DCS_INSTALL_DIR}/logs/*.out.[0-9]*
+ fi
 }
 
 function rest_logs() {
+ if [[ ! -z $L_PDSH ]]; then
    $L_PDSH rm -f ${REST_INSTALL_DIR}/logs/*.log
    $L_PDSH rm -f ${REST_INSTALL_DIR}/logs/*.log.[0-9]*
    $L_PDSH rm -f ${REST_INSTALL_DIR}/logs/*.out
    $L_PDSH rm -f ${REST_INSTALL_DIR}/logs/*.out.[0-9]*
+ fi
 }
 
 function all_logs() {

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/cbcde79e/core/sqf/sql/scripts/dcscheck
----------------------------------------------------------------------
diff --git a/core/sqf/sql/scripts/dcscheck b/core/sqf/sql/scripts/dcscheck
index 15006d7..52cbac1 100755
--- a/core/sqf/sql/scripts/dcscheck
+++ b/core/sqf/sql/scripts/dcscheck
@@ -67,7 +67,7 @@ if [[ $sq_stat == 0 ]]; then
   if [ -s ${DCS_INSTALL_DIR}/conf/backup-masters ]; then
      let backup_dcsmaster_cnt=`/bin/egrep -cv '#|^$' ${DCS_INSTALL_DIR}/conf/backup-masters`
      let cfg_dcsmaster_cnt=$backup_dcsmaster_cnt+1
-     list_of_backups=`cat ${DCS_INSTALL_DIR}/conf/backup-masters | /bin/egrep -v '^#|^$'|tr -d '\n'`
+     list_of_backups=`cat ${DCS_INSTALL_DIR}/conf/backup-masters | /bin/egrep -v '^#|^$'|paste -sd ' ' -`
    else
      let cfg_dcsmaster_cnt=1
    fi
@@ -96,12 +96,12 @@ if [[ $sq_stat == 0 ]]; then
         else
            interface_to_use=$floatip_interface
         fi
-        activeMaster=`$L_PDSH /sbin/ip addr show |grep $interface_to_use$ |cut -d '/' -f1 |awk '{print $3}'`
+        activeMaster=`$L_PDSH /sbin/ip addr show |grep $interface_to_use$ |cut -d':' -f1`
         if [[ ! -z $activeMaster ]]; then
-           activeDcsPid=`$L_PDSH $jpscmd |grep DcsMaster |grep $activeMaster |cut -d" " -f2 |tr -d '\n'`
+           activeDcsPid=`$L_PDSH $jpscmd |grep DcsMaster |grep $activeMaster |cut -d" " -f2 |paste -sd ' ' -`
         fi
      else
-        activeMaster=`$L_PDSH $jpscmd |grep DcsMaster |cut -d":" -f1 |tr -d '\n'`
+        activeMaster=`$L_PDSH $jpscmd |grep DcsMaster |cut -d":" -f1 |paste -sd ' ' -`
      fi
 
      if ( [ -z $activeMaster ] && [ "$actual_dcsmaster_cnt" '>' 0 ] && [ "$actual_dcsserver_cnt" '>' 0 ] ); then
@@ -149,13 +149,13 @@ if [[ $sq_stat == 0 ]]; then
    masterport=`cat $dcstmp | /usr/bin/tail -n 1 | cut -d ":" -f4`
    if [ ! -z "$masterport" ]; then
      echo -e "DcsMaster listen port: $masterport\n"
-     if [[ ! -z $primary_dcsmaster ]]; then
+     if [[ ! -z "$primary_dcsmaster" ]]; then
         echo "Configured Primary DcsMaster: \"$primary_dcsmaster\""
      fi
-     if [[ ! -z $list_of_backups ]]; then
+     if [[ ! -z "$list_of_backups" ]]; then
         echo "Configured Backup DcsMasters: \"$list_of_backups\""
      fi
-     if ( [ ! -z $activeMaster ] && [ ! -z $activeDcsPid ] ); then
+     if ( [ ! -z "$activeMaster" ] && [ ! -z "$activeDcsPid" ] ); then
         echo "Active DcsMaster            : \"$activeMaster\", pid $activeDcsPid"
      else
         echo "Active DcsMaster            : \"$activeMaster\""