Author: jfthomps
Date: Tue Jun 13 20:59:10 2017
New Revision: 1798641

URL: http://svn.apache.org/viewvc?rev=1798641&view=rev
Log:
VCL-1053 - Prepare VCL 2.5 release

vcl-upgrade.sh:
-when upgrading database, added code for VCL versions in the 2.x series to 
grant CREATE TEMPORARY TABLES to VCL db user
-fixed bug in how new management node code was getting copied into place

Modified:
    vcl/trunk/vcl-upgrade.sh

Modified: vcl/trunk/vcl-upgrade.sh
URL: 
http://svn.apache.org/viewvc/vcl/trunk/vcl-upgrade.sh?rev=1798641&r1=1798640&r2=1798641&view=diff
==============================================================================
--- vcl/trunk/vcl-upgrade.sh (original)
+++ vcl/trunk/vcl-upgrade.sh Tue Jun 13 20:59:10 2017
@@ -663,6 +663,12 @@ if [[ $DODB -eq 1 ]]; then
                if [ $? -ne 0 ]; then generic_error "Failed to create backup of 
$DB_NAME database"; exit 1; fi;
                gzip $WORKPATH/vcl-${OLD_VERSION}-backup.sql
        fi
+
+       if [[ $OLD_VERSION = '2.2' || $OLD_VERSION = '2.2.1' ||$OLD_VERSION = 
'2.2.2' ]]; then
+               for dbuser in $(mysql -NBe "SELECT User FROM db WHERE Db = 
'$DB_NAME' AND User != '' AND Host = '$DB_HOST'" mysql); do
+                       mysql -e "GRANT CREATE TEMPORARY TABLES ON vcl.* TO 
'$dbuser'@'$DB_HOST';"
+               done
+       fi
 fi
 
 # -------------------------- backup web code -------------------------
@@ -752,15 +758,15 @@ if [[ $DOMN -eq 1 ]]; then
        print_break
        echo "Installing management node components..."
        if [[ ! -d ${MN_PATH}-$OLD_VERSION ]]; then
-               /bin/cp -ar ${MN_PATH} ${MN_PATH}-$VCL_VERSION
+               /bin/mv ${MN_PATH} ${MN_PATH}-$OLD_VERSION
                if [ $? -ne 0 ]; then generic_error "Failed to install new VCL 
management node code (1)"; exit 1; fi;
-               chown -R root:root ${MN_PATH}-$VCL_VERSION/
-               if [ $? -ne 0 ]; then generic_error "Failed to set ownership of 
VCL management node code to root"; exit 1; fi;
        fi
        /bin/cp -ar ${MN_PATH}-$OLD_VERSION ${MN_PATH}-$VCL_VERSION
        if [ $? -ne 0 ]; then generic_error "Failed to install new VCL 
management node code (2)"; exit 1; fi;
        /bin/cp -ar $WORKPATH/apache-VCL-$VCL_VERSION/managementnode/* 
${MN_PATH}-$VCL_VERSION
        if [ $? -ne 0 ]; then generic_error "Failed to install new VCL 
management node code (3)"; exit 1; fi;
+       chown -R root:root ${MN_PATH}-$VCL_VERSION/
+       if [ $? -ne 0 ]; then generic_error "Failed to set ownership of VCL 
management node code to root"; exit 1; fi;
 fi
 
 # -------------------- configure management node code ------------------


Reply via email to