You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kylin.apache.org by li...@apache.org on 2017/03/31 06:59:57 UTC

[07/21] kylin git commit: KYLIN-2280 minor, reset to init before modify ports

KYLIN-2280 minor,reset to init before modify ports

Signed-off-by: Hongbin Ma <ma...@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/kylin/repo
Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/40249fee
Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/40249fee
Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/40249fee

Branch: refs/heads/KYLIN-2501
Commit: 40249fee78a8a078d461ea66009111082732d27b
Parents: 6c800d6
Author: xiefan46 <95...@qq.com>
Authored: Fri Mar 17 11:27:08 2017 +0800
Committer: Hongbin Ma <ma...@apache.org>
Committed: Fri Mar 17 12:53:11 2017 +0800

----------------------------------------------------------------------
 build/bin/kylin_port_replace_util.sh | 15 ++++++++++-----
 build/script/download-tomcat.sh      |  1 +
 2 files changed, 11 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kylin/blob/40249fee/build/bin/kylin_port_replace_util.sh
----------------------------------------------------------------------
diff --git a/build/bin/kylin_port_replace_util.sh b/build/bin/kylin_port_replace_util.sh
index a51e60d..366d8d0 100755
--- a/build/bin/kylin_port_replace_util.sh
+++ b/build/bin/kylin_port_replace_util.sh
@@ -31,6 +31,7 @@ else
 fi
 
 #variables
+TOMCAT_INIT_FILE="${KYLIN_HOME}/tomcat/conf/server.xml.init"
 TOMCAT_BACKUP_FILE="${KYLIN_HOME}/tomcat/conf/server.xml.backup"
 TOMCAT_CONFIG_FILE="${KYLIN_HOME}/tomcat/conf/server.xml"
 KYLIN_CONFIG_FILE="${KYLIN_HOME}/conf/kylin.properties"
@@ -49,6 +50,15 @@ then
         exit 1
     fi
 
+
+    #backup tomccat file
+    if [ ! -f ${TOMCAT_BACKUP_FILE} ]; then
+        cp -f ${TOMCAT_CONFIG_FILE} ${TOMCAT_BACKUP_FILE}
+    fi
+
+    #force reset
+    cp -f ${TOMCAT_INIT_FILE} ${TOMCAT_CONFIG_FILE} #reset if exist
+
     #back or reset
     if [ ! -f ${KYLIN_BACKUP_FILE} ]; then  #backup if not exist
         cp -f ${KYLIN_CONFIG_FILE} ${KYLIN_BACKUP_FILE}
@@ -56,11 +66,6 @@ then
         cp -r ${KYLIN_BACKUP_FILE} ${KYLIN_CONFIG_FILE} #reset if exist
     fi
 
-    if [ ! -f ${TOMCAT_BACKUP_FILE} ]; then  #backup if not exist
-        cp -f ${TOMCAT_CONFIG_FILE} ${TOMCAT_BACKUP_FILE}
-    else
-        cp -r ${TOMCAT_BACKUP_FILE} ${TOMCAT_CONFIG_FILE} #reset if exist
-    fi
 
     #replace ports in kylin.properties
     new_kylin_port=`expr ${KYLIN_DEFAULT_PORT} + ${OFFSET}`

http://git-wip-us.apache.org/repos/asf/kylin/blob/40249fee/build/script/download-tomcat.sh
----------------------------------------------------------------------
diff --git a/build/script/download-tomcat.sh b/build/script/download-tomcat.sh
index 964400f..b0ff137 100755
--- a/build/script/download-tomcat.sh
+++ b/build/script/download-tomcat.sh
@@ -51,6 +51,7 @@ rm -rf build/tomcat/webapps/*
 mv build/tomcat/conf/server.xml build/tomcat/conf/server.xml.bak
 mv build/tomcat/conf/context.xml build/tomcat/conf/context.xml.bak
 cp build/deploy/server.xml build/tomcat/conf/server.xml
+cp build/deploy/server.xml build/tomcat/conf/server.xml.init
 echo "server.xml overwritten..."
 cp build/deploy/context.xml build/tomcat/conf/context.xml
 echo "context.xml overwritten..."