1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-04-18 21:44:02 +03:00

MCOL-939 Moved columnstore version information to columnstoreversion.h for 1.1.X

This commit is contained in:
Roman Nozdrin 2017-12-12 22:53:33 +03:00
parent 2ed4bc2e72
commit bea47cc657
34 changed files with 53 additions and 2125 deletions

View File

@ -37,6 +37,8 @@ ENDIF(NOT CMAKE_BUILD_TYPE)
#set( CMAKE_VERBOSE_MAKEFILE on )
INCLUDE(columnstore_version.cmake)
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/columnstoreversion.h.in ${CMAKE_CURRENT_SOURCE_DIR}/columnstoreversion.h)
SET (PACKAGE columnstore)
SET (PACKAGE_NAME columnstore)
@ -76,8 +78,7 @@ ENDIF("${isSystemDir}" STREQUAL "-1")
INCLUDE (configureEngine.cmake)
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/build/releasenum.in ${CMAKE_CURRENT_BINARY_DIR}/build/releasenum @ONLY IMMEDIATE)
INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/build/releasenum DESTINATION ${INSTALL_ENGINE} COMPONENT platform)
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/columnstoreversion.h.in ${CMAKE_CURRENT_SOURCE_DIR}/columnstoreversion.h)
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config.h)
INCLUDE(bison.cmake)

View File

@ -1,18 +0,0 @@
for /f "delims= skip=1" %%x in (releasenum) do (set "%%x")
set packager="%USERNAME% <%USERNAME%@calpont.com>"
echo %packager%
set builddate="%DATE:~10,4%-%DATE:~4,2%-%DATE:~7,2% %TIME:~0,2%:%TIME:~3,2%:%TIME:~6,2%"
set buildmachine=%computername%
copy /Y .\CalpontVersion.txt.in ..\utils\winport\CalpontVersion.txt
sed -i -e s/@@PACKAGER@@/%packager%/ ..\utils\winport\CalpontVersion.txt
sed -i -e s/@@BUILDDATE@@/%builddate%/ ..\utils\winport\CalpontVersion.txt
sed -i -e s/@@VERSION@@/%version%/ ..\utils\winport\CalpontVersion.txt
sed -i -e s/@@RELEASE@@/%release%/ ..\utils\winport\CalpontVersion.txt
sed -i -e s/@@BUILDMACHINE@@/%buildmachine%/ ..\utils\winport\CalpontVersion.txt
:: For some unknown reason, sed removes permissions. Put them back.
icacls ..\utils\winport\CalpontVersion.txt /grant SYSTEM:F administrators:F
cd ..
git status | grep "On branch" >> utils\winport\CalpontVersion.txt
git log -1 | head -3 | egrep "^(commit|Date)" >> utils\winport\CalpontVersion.txt
cd build

View File

@ -1,60 +0,0 @@
#!/bin/bash
#
# $Id: bootstrap 1333 2011-01-18 17:25:26Z rdempsey $
#
# This script is responsible for setting up a fresh development tree
# following a git checkout. It copies static files and shared include
# files to the export tree prior to building the software.
set -e
mkdir -p export/mysql
#FIXME rename this
cp dbcon/mysql/install_calpont_mysql.sh export/mysql/
#TODO: see if this my.cnf is necessary
cp dbcon/mysql/my.cnf export/mysql/.
#TODO: the init.d service file should not be mixed case
#TODO: the init.d service file should not contain calpont
cp dbcon/mysql/mysql-Columnstore export/mysql/ && \
cp build/files.lst export/mysql/ && \
cp dbcon/mysql/install_calpont_mysql.sh export/mysql/ && \
cp dbcon/mysql/my.cnf export/mysql/ && \
cp dbcon/mysql/mysql-Columnstore export/mysql/
#FIXME:
#This is not going to update the version in configure.ac
echo Generating version header
./build/genVersion.sh
if [ $? -ne 0 ]; then
echo Could not generate version header
exit $?
fi
echo Running GNU autotools to generate build environment
aclocal && \
autoconf && \
autoheader && \
libtoolize && \
automake --add-missing && \
autoreconf
if [ $? -ne 0 ]; then
echo GNU autotools generation failed
exit $?
fi
echo GNU autotools environment generation completed successfully
#cd net-snmp/net-snmp
# ./configure --prefix=$PREFIX --with-mib-modules=disman/event-mib --with-cc=gcc \
# --with-logfile=$PREFIX/log/snmpd.log \
# --with-sys-location=Unknown \
# --with-sys-contact=root@localhost.localdomain \
# --with-default-snmp-version=3 \
# --with-persistent-directory=$PREFIX/var/net-snmp \
# --without-openssl \
# --with-ldflags="-Wl,-rpath -Wl,$PREFIX/lib"

View File

@ -49,7 +49,7 @@ for lib in libnetsnmpagent.so libnetsnmphelpers.so libnetsnmpmibs.so libnetsnmp.
done
popd >/dev/null
./build/genVersion.sh
#./build/genVersion.sh
for x in \
$(find . -name '[mM]akefile' \

View File

@ -1,143 +0,0 @@
#!/bin/bash
#
# $Id: build_rpms 1734 2012-10-25 18:07:16Z dlhill $
#
verbose=0
prefix=/usr/local/mariadb/columnstore
#mysqldir=$prefix/mariadb-columnstore/mysql
columnstoredir=$prefix
# set default as community
community=true
usage()
{
cat <<EOD
usage: build_rpms [--community] [--verbose] [--local-mysql] [--help]
--local-mysql use local (relative) mysql binary tree
EOD
}
for arg in "$@"; do
if [ `expr -- "$arg" : '--verbose'` -eq 9 ]; then
((verbose++))
elif [ `expr -- "$arg" : '--local-mysql'` -eq 13 ]; then
mysqldir=../mariadb/columnstore/mysql
elif [ `expr -- "$arg" : '--help'` -eq 6 ]; then
usage
exit 0
elif [ `expr -- "$arg" : '--community'` -eq 11 ]; then
community=true
else
echo "ignoring unknown argument: $arg" 1>&2
fi
done
#try to find project root
while [ ! -d dbcon ]; do
cd ..
curdir=$(pwd)
if [ $curdir = / -o $curdir = $HOME ]; then
echo "I could not find the project root directory: I can't continue!"
exit 1
fi
done
if [ ! -f ./build/releasenum ]; then
echo "I could not find the file 'releasesum' in the build directory: I can't continue!"
exit 1
fi
. ./build/releasenum
# make the install package
buildroot=$HOME/rpm/BUILD/mariadb-columnstore-$version.$release
sudo rm -rf $buildroot
mkdir -p $buildroot
mkdir -p $buildroot/mariadb/columnstore
echo -n "Writing binary files to $buildroot..."
sudo chown -R builder:builder $columnstoredir
/bin/cp -f -r $columnstoredir/* $buildroot/mariadb/columnstore/.
/bin/cp -r build/releasenum $buildroot/mariadb/columnstore/.
#get mysql server files
#pushd $mysqldir > /dev/null
#mkdir -p $buildroot/mariadb/columnstore/mysql
#cpio -pdmu --quiet $buildroot/mariadb/columnstore/mysql < files.lst
#popd >/dev/null
#clean up some files from buildroot
rm -f $buildroot/mariadb/columnstore/etc/Doxyfile
for file in $buildroot/mariadb/columnstore/lib/*; do
if [ -h $file ]; then
rm -f $file
fi
done
#temporarily clean up these BRM thingies
for file in dbrm script-fcns; do
rm -f $buildroot/mariadb/columnstore/bin/$file
done
#clean up these bulkload scripts
for file in bulkload.sh cleanup.sh dbbuilder.sh dbload.sh cpimport.sh bulkloadp.sh; do
rm -f $buildroot/mariadb/columnstore/bin/$file
done
rm -f $buildroot/mariadb/columnstore/lib/libidbboot.a
rm -f $buildroot/mariadb/columnstore/lib/libiberty.a
mkdir -p $HOME/rpm/BUILD $HOME/rpm/RPMS $HOME/rpm/SRPMS $HOME/rpm/SPECS $HOME/rpm/tmp
if [ ! -f $HOME/.rpmmacros ]; then
cat > $HOME/.rpmmacros <<EOD
%_topdir $HOME/rpm
%_tmppath $HOME/rpm/tmp
# Change to 1 if you want to abort on unpackaged files
%_unpackaged_files_terminate_build 0
EOD
fi
#twiddle with the spec file
packager="support@mariadb.com"
tag=poc
buildinfo=`./build/docBuild $tag | (
read l
b="$l"
while read l; do
b="$b\\n$l"
done
echo $b )`
if [ ! $community ]; then
cp ./build/columnstore.spec.in $HOME/rpm/SPECS/columnstore.spec
else
cp ./build/columnstore.community.spec.in $HOME/rpm/SPECS/columnstore.spec
fi
sed -i -e "s/@@PACKAGER@@/Packager: $packager/" \
-e "s/@@VERSION@@/Version: $version/" \
-e "s/@@RELEASE@@/Release: $release/" \
-e "s?@@BUILDINFO@@?$buildinfo?" $HOME/rpm/SPECS/columnstore.spec
echo done.
echo -n "Building rpms..."
rpmbuild -ba $HOME/rpm/SPECS/columnstore.spec > /tmp/rpmbuild.out.$$ 2>&1
rc=$?
echo done.
if [ $verbose -gt 0 -o $rc -ne 0 ]; then
cat /tmp/rpmbuild.out.$$
fi
rm -f /tmp/*.$$
exit $rc

View File

@ -1,49 +0,0 @@
#!/bin/bash
#
# $Id: genVersion.sh 1019 2009-12-18 14:42:35Z rdempsey $
#
#prefix=export
#for arg in "$@"; do
# if [ `expr -- "$arg" : '--prefix='` -eq 9 ]; then
# prefix="`echo $arg | awk -F= '{print $2}'`"
# else
# echo "ignoring unknown argument: $arg" 1>&2
# fi
#done
#
##try to find project root
#while [ ! -d dbcon ]; do
# cd ..
# curdir=$(pwd)
# if [ $curdir = / -o $curdir = $HOME ]; then
# echo "I could not find the project root directory: I can't continue!"
# exit 1
# fi
#done
#
#if [ ! -f ./build/releasenum ]; then
# echo "I could not find the file 'releasesum' in the build directory: I can't continue!"
# exit 1
#fi
. ./build/releasenum
#mkdir -p ${prefix}/include
echo "
#ifndef VERSIONNUMBER_H_
#define VERSIONNUMBER_H_
#include <string>
const std::string idb_version(\"$version\");
const std::string idb_release(\"$release\");
#endif
" > dbcon/mysql/versionnumber.h.tmp
diff -bBq dbcon/mysql/versionnumber.h.tmp dbcon/mysql/versionnumber.h >/dev/null 2>&1
if [ $? -ne 0 ]; then
cp dbcon/mysql/versionnumber.h.tmp dbcon/mysql/versionnumber.h
fi
rm -f dbcon/mysql/versionnumber.h.tmp

View File

@ -1,135 +0,0 @@
#!/bin/bash
#
# $Id: make_src_tar 1932 2013-06-20 18:26:27Z dhill $
#
# basedir is the working dir for all the activity
basedir=$HOME
# vname is the name of the top-level dir in the tar file
vname=
# ofile is the output tar file name and is relative to a hidden dir, so it should be absolute
ofile=
# branch is the branch to checkout (develop by default)
branch=
for arg in "$@"; do
if [ $(expr -- "$arg" : '--basedir=') -eq 10 ]; then
basedir="$(echo $arg | awk -F= '{print $2}')"
elif [ $(expr -- "$arg" : '--vname=') -eq 8 ]; then
vname="$(echo $arg | awk -F= '{print $2}')"
elif [ $(expr -- "$arg" : '--ofile=') -eq 8 ]; then
ofile="$(echo $arg | awk -F= '{print $2}')"
elif [ $(expr -- "$arg" : '--branch=') -eq 9 ]; then
branch="$(echo $arg | awk -F= '{print $2}')"
else
echo "ignoring unknown argument: $arg" 1>&2
fi
done
if [ -f releasenum ]; then
. releasenum
elif [ -f build/releasenum ]; then
. build/releasenum
else
echo "Couldn't locate 'releasenum' file in the build dir, make sure running in top-level dir"
fi
if [ -z "$version" ]; then
echo "Version defaulting to 4.0-develop"
version=4.0
release=develop
fi
if [ -z "$release" ]; then
release=0
fi
blddir=bld.$$
if [ -z "$vname" ]; then
vname=infinidb-${version}
fi
if [ -z "$ofile" ]; then
ofile=${basedir}/${vname}-${release}.src.tar.gz
fi
co_dir=$blddir/$vname
trap "{ echo; cd ${basedir}; rm -rf $blddir; exit 1; }" TERM INT ERR
cd ${basedir}
rm -rf $blddir
mkdir -p $co_dir
cd $co_dir
branch_arg=
if [ ! -z "$branch" ]; then
branch_arg="-b $branch"
else
branch=develop
fi
echo -n "getting git source from $branch..."
git clone http://srvengcm1.calpont.com/repos/infinidb.git infinidb
cd infinidb
git checkout $branch
echo "done."
test -d build || exit 1
echo -n "cleaning git source for "
echo -n "release..."
rm -rf .git .gitignore
rm -rf qa export
rm -f rules.mak
find . -name Makefile | xargs rm -f
find . -name \*.xmi | xargs rm -f
rm -f dbcon/joblist/bandeddl.h.set dbcon/joblist/bandeddl.h.vector primitives/blockcache/iomanager.cpp.single-read \
primitives/udf/Makefile.sdk
rm -rf utils/scenarios
cd mysql
rm -rf scripts queries storage/maria
cd ..
rm -rf writeengine/test/*
rm -rf utils/net-snmp-built-libs
rm -rf utils/multicast
rm -rf utils/openpgm
rm -rf tools/reserveStacks
rm -rf dbcon/doc dbcon/ingres dbcon/plsql
cd tools
rm -rf brmtest dataPump evalidx fixdate nettest pgm pingproc rebuildEM snconvert updateGenii valprint
rm -rf cfread dbgen dbgen-ssb ddldriver dmldriver idb_comp sendPlan vbgen
cd ..
rm -rf utils/libstatgrab utils/libxml utils/testbc utils/configcpp/md5
echo "done."
cd ..
echo -n "getting MySQL..."
git clone https://github.com/infinidb/mysql mysql
cd mysql
git checkout $branch
echo "done."
cd ..
echo -n "building tarball..."
cd infinidb
cp -r utils/autoconf/* .
cp INSTALL INSTALL.keep
cp install-sh install-sh.keep
rm -rf utils/autoconf
autoreconf --force --install
rm -f INSTALL install-sh
mv INSTALL.keep INSTALL
mv install-sh.keep install-sh
cd ..
ln -s infinidb/INSTALL
ln -s infinidb/README
cd ..
tar -zcf $ofile $vname
echo "done."
echo "tarball left in $ofile"
cd ${basedir}
rm -rf $blddir

View File

@ -1,2 +1,2 @@
version=@PACKAGE_VERSION@
release=@PACKAGE_RELEASE@
version=${PACKAGE_VERSION}
release=${PACKAGE_RELEASE}

7
columnstoreversion.h.in Normal file
View File

@ -0,0 +1,7 @@
#ifndef VERSIONNUMBER_H_
#define VERSIONNUMBER_H_
#include <string>
const std::string columnstore_version("${VERSION}");
const std::string columnstore_release("${PACKAGE_RELEASE}");
#endif

View File

@ -108,7 +108,7 @@
*/
#include "ha_calpont.h"
#include "versionnumber.h"
#include "columnstoreversion.h"
#define NEED_CALPONT_EXTERNS
#include "ha_calpont_impl.h"
@ -201,7 +201,7 @@ static int columnstore_init_func(void *p)
tm.tm_year % 100, tm.tm_mon + 1, tm.tm_mday,
tm.tm_hour, tm.tm_min, tm.tm_sec);
fprintf(stderr, "Columnstore: Started; Version: %s-%s\n", idb_version.c_str(), idb_release.c_str());
fprintf(stderr, "Columnstore: Started; Version: %s-%s\n", columnstore_version.c_str(), columnstore_release.c_str());
calpont_hton= (handlerton *)p;
#ifndef _MSC_VER
@ -234,7 +234,7 @@ static int infinidb_init_func(void *p)
tm.tm_year % 100, tm.tm_mon + 1, tm.tm_mday,
tm.tm_hour, tm.tm_min, tm.tm_sec);
fprintf(stderr, "InfiniDB: Started; Version: %s-%s\n", idb_version.c_str(), idb_release.c_str());
fprintf(stderr, "Columnstore: Started; Version: %s-%s\n", columnstore_version.c_str(), columnstore_release.c_str());
calpont_hton= (handlerton *)p;

View File

@ -141,7 +141,7 @@ using namespace logging;
using namespace funcexp;
#include "installdir.h"
#include "versionnumber.h"
#include "columnstoreversion.h"
namespace cal_impl_if
{
@ -2286,7 +2286,7 @@ const char* calgetversion(UDF_INIT* initid, UDF_ARGS* args,
char* result, unsigned long* length,
char* is_null, char* error)
{
string version(idb_version);
string version(columnstore_version);
*length = version.size();
memcpy(result, version.c_str(), *length);
return result;

View File

@ -36,15 +36,6 @@ echo "################# mcsadmin getcolumnstoresoftwareinfo #################"
echo " "
$INSTALLDIR/bin/mcsadmin getsoftwareinfo
if [ -e $INSTALLDIR/releasenum ];then
echo " "
echo "-- Columnstore Release Number file --"
echo " "
echo "################# cat $INSTALLDIR/releasenum #################"
echo " "
cat $INSTALLDIR/releasenum
fi
echo " "
echo "-- Columnstore Storage Configuration --"
echo " "

View File

@ -46,6 +46,7 @@
#include <csignal>
#include <sstream>
#include "columnstoreversion.h"
#include "ddlpkg.h"
#include "../../dbcon/dmlpackage/dmlpkg.h"
#define LIBOAM_DLLEXPORT
@ -148,74 +149,13 @@ namespace oam
/********************************************************************
*
* get System Software information
*
* (for backward compatibility only)
********************************************************************/
void Oam::getSystemSoftware(SystemSoftware& systemsoftware)
{
// parse releasenum file
string rn = InstallDir + "/releasenum";
ifstream File(rn.c_str());
if (!File)
// Open File error
return;
char line[400];
string buf;
while (File.getline(line, 400))
{
buf = line;
for ( unsigned int i = 0;; i++)
{
if ( SoftwareData[i] == "")
//end of list
break;
string data = "";
string::size_type pos = buf.find(SoftwareData[i],0);
if (pos != string::npos)
{
string::size_type pos1 = buf.find("=",pos);
if (pos1 != string::npos)
{
data = buf.substr(pos1+1, 80);
}
else
// parse error
exceptionControl("getSystemSoftware", API_FAILURE);
//strip off any leading or trailing spaces
for(;;)
{
string::size_type pos = data.find(' ',0);
if (pos == string::npos)
// no more found
break;
// strip leading
if (pos == 0) {
data = data.substr(pos+1,10000);
}
else
{ // strip trailing
data = data.substr(0, pos);
}
}
switch(i)
{
case(0): // line up with SoftwareData[]
systemsoftware.Version = data;
break;
case(1):
systemsoftware.Release = data;
break;
}
}
} //end of for loop
} //end of while
File.close();
systemsoftware.Version = columnstore_version;
systemsoftware.Release = columnstore_release;
}
/********************************************************************
*

View File

@ -25,6 +25,7 @@
#include <netdb.h>
extern int h_errno;
#include "columnstoreversion.h"
#include "calpontConsole.h"
#include "boost/filesystem/operations.hpp"
#include "boost/filesystem/path.hpp"
@ -703,7 +704,6 @@ int processCommand(string* arguments)
case 4: // getSystemConfig
{
SystemSoftware systemsoftware;
SystemConfig systemconfig;
string returnValue;
@ -714,14 +714,13 @@ int processCommand(string* arguments)
try
{
oam.getSystemSoftware(systemsoftware);
oam.getSystemConfig(systemconfig);
cout << endl << "System Configuration" << endl << endl;
cout << "SystemName = " << systemconfig.SystemName << endl;
cout << "SoftwareVersion = " << systemsoftware.Version << endl;
cout << "SoftwareRelease = " << systemsoftware.Release << endl;
cout << "SoftwareVersion = " << columnstore_version << endl;
cout << "SoftwareRelease = " << columnstore_release << endl;
cout << "ParentOAMModuleName = " << systemconfig.ParentOAMModule << endl;
cout << "StandbyOAMModuleName = " << systemconfig.StandbyOAMModule << endl;
@ -4836,21 +4835,15 @@ int processCommand(string* arguments)
if (oam.checkLogStatus("/tmp/calpont.txt", "Status: install"))
system("cat /tmp/calpont.txt");
else {
SystemSoftware systemsoftware;
oam.getSystemSoftware(systemsoftware);
cout << "SoftwareVersion = " << systemsoftware.Version << endl;
cout << "SoftwareRelease = " << systemsoftware.Release << endl;
cout << "SoftwareVersion = " << columnstore_version << endl;
cout << "SoftwareRelease = " << columnstore_release << endl;
}
}
}
else
{
SystemSoftware systemsoftware;
oam.getSystemSoftware(systemsoftware);
cout << "SoftwareVersion = " << systemsoftware.Version << endl;
cout << "SoftwareRelease = " << systemsoftware.Release << endl;
cout << "SoftwareVersion = " << columnstore_version << endl;
cout << "SoftwareRelease = " << columnstore_release << endl;
}
cout << endl;
break;

View File

@ -1,53 +0,0 @@
#!/bin/bash
#
# $Id: hardwareReport.sh 421 2007-04-05 15:46:55Z dhill $
#
if [ $1 ] ; then
MODULE=$1
else
MODULE="pm1"
fi
if [ $2 ] ; then
INSTALLDIR=$2
else
INSTALLDIR="/usr/local/mariadb/columnstore"
fi
if [ $USER = "root" ]; then
SUDO=" "
else
SUDO="sudo"
fi
$SUDO rm -f /tmp/${MODULE}_softwareReport.txt
{
echo " "
echo "******************** Software Report for ${MODULE} ********************"
echo " "
echo " "
echo "-- Calpont Package Details --"
echo " "
echo "################# mcsadmin getcalpontsoftwareinfo #################"
echo " "
$INSTALLDIR/bin/mcsadmin getcalpontsoftwareinfo
echo " "
echo "-- Calpont Release Number file --"
echo " "
echo "################# cat $INSTALLDIR/releasenum #################"
echo " "
cat $INSTALLDIR/releasenum
echo " "
echo "-- Calpont Storage Configuration --"
echo " "
echo "################# mcsadmin getStorageConfig #################"
echo " "
$INSTALLDIR/bin/mcsadmin getStorageConfig
} > /tmp/${MODULE}_softwareReport.txt
exit 0

View File

@ -33,14 +33,7 @@ echo "-- Columnstore Package Details --"
echo " "
echo "################# mcsadmin getcolumnstoresoftwareinfo #################"
echo " "
$INSTALLDIR/bin/mcsadmin getcolumnstoresoftwareinfo
echo " "
echo "-- Columnstore Release Number file --"
echo " "
echo "################# cat $INSTALLDIR/releasenum #################"
echo " "
cat $INSTALLDIR/releasenum
$INSTALLDIR/bin/mcsadmin getsoftwareinfo
echo " "
echo "-- Columnstore Storage Configuration --"

View File

@ -26,6 +26,7 @@
#include <netdb.h>
extern int h_errno;
#include "columnstoreversion.h"
#include "mcsadmin.h"
#include "boost/filesystem/operations.hpp"
#include "boost/filesystem/path.hpp"
@ -5046,21 +5047,15 @@ int processCommand(string* arguments)
if (WEXITSTATUS(rtnCode) == 0)
system("cat /tmp/columnstore.txt");
else {
SystemSoftware systemsoftware;
oam.getSystemSoftware(systemsoftware);
cout << "SoftwareVersion = " << systemsoftware.Version << endl;
cout << "SoftwareRelease = " << systemsoftware.Release << endl;
cout << "SoftwareVersion = " << columnstore_version << endl;
cout << "SoftwareRelease = " << columnstore_release << endl;
}
}
}
else
{
SystemSoftware systemsoftware;
oam.getSystemSoftware(systemsoftware);
cout << "SoftwareVersion = " << systemsoftware.Version << endl;
cout << "SoftwareRelease = " << systemsoftware.Release << endl;
cout << "SoftwareVersion = " << columnstore_version << endl;
cout << "SoftwareRelease = " << columnstore_release << endl;
}
cout << endl;
break;

View File

@ -46,6 +46,7 @@
#include <readline/readline.h>
#include <readline/history.h>
#include "columnstoreversion.h"
#include "liboamcpp.h"
#include "configcpp.h"
#include "alarmmanager.h"
@ -220,10 +221,7 @@ int main(int argc, char *argv[])
postConfigureLog = true;
}
else if( string("-v") == argv[i] ) {
SystemSoftware systemsoftware;
oam.getSystemSoftware(systemsoftware);
cout << endl << "columnstore Version: " << systemsoftware.Version << "-" << systemsoftware.Release << endl;
cout << "columnstore Version: " << columnstore_version << "-" << columnstore_release << endl;
exit (0);
}
else if( string("-pc") == argv[i] ) {
@ -1289,10 +1287,7 @@ int main(int argc, char *argv[])
cout << "===== Setting up system '" + systemName + "' based on these settings ===== " << endl << endl;
SystemSoftware systemsoftware;
oam.getSystemSoftware(systemsoftware);
cout << "columnstore Version = " << systemsoftware.Version << "-" << systemsoftware.Release << endl;
cout << "columnstore Version = " << columnstore_version << "-" << columnstore_release << endl;
cout << "System Type = " << systemType << endl;
if ( subnetID != oam::UnassignedName ) {

View File

@ -69,6 +69,7 @@
#include "boost/filesystem/path.hpp"
#include "boost/tokenizer.hpp"
#include "columnstoreversion.h"
#include "liboamcpp.h"
#include "configcpp.h"

View File

@ -223,7 +223,7 @@ void diskMonitor()
string fileName;
// check local
if ( deviceName == "/") {
fileName = deviceName + "usr/local/mariadb/columnstore/releasenum";
fileName = deviceName + "usr/local/mariadb/columnstore/";
}
else
{

View File

@ -27,6 +27,7 @@
#include <boost/filesystem.hpp>
#include "columnstoreversion.h"
#include "processmanager.h"
#include "installdir.h"
@ -507,24 +508,7 @@ static void startMgrProcessThread()
log.writeLog(__LINE__, "startMgrProcessThread launched", LOG_TYPE_DEBUG);
//get calpont software version and release
SystemSoftware systemsoftware;
string softwareVersion;
string softwareRelease;
try
{
oam.getSystemSoftware(systemsoftware);
softwareVersion = systemsoftware.Version;
softwareRelease = systemsoftware.Release;
}
catch (exception& e) {
cout << endl << "ProcMon Construct Error reading getSystemSoftware = " << e.what() << endl;
exit(-1);
}
string localSoftwareInfo = softwareVersion + softwareRelease;
string localSoftwareInfo = columnstore_version + columnstore_release;
//get systemStartupOffline
string systemStartupOffline = "n";
try {

View File

@ -24,6 +24,7 @@
//#define NDEBUG
#include <cassert>
#include "columnstoreversion.h"
#include "processmanager.h"
#include "installdir.h"
#include "dbrm.h"
@ -4565,12 +4566,12 @@ int ProcessManager::addModule(oam::DeviceNetworkList devicenetworklist, std::str
}
if ( packageType == "rpm")
calpontPackage = homedir + "/mariadb-columnstore*" + systemsoftware.Version + "-" + systemsoftware.Release + "*.rpm.tar.gz";
calpontPackage = homedir + "/mariadb-columnstore*" + columnstore_version + "-" + columnstore_release + "*.rpm.tar.gz";
else
if ( packageType == "deb")
calpontPackage = homedir + "/mariadb-columnstore*" + systemsoftware.Version + "-" + systemsoftware.Release + "*.deb.tar.gz";
calpontPackage = homedir + "/mariadb-columnstore*" + columnstore_version + "-" + columnstore_release + "*.deb.tar.gz";
else
calpontPackage = homedir + "/mariadb-columnstore*" + systemsoftware.Version + "-" + systemsoftware.Release + "*.bin.tar.gz";
calpontPackage = homedir + "/mariadb-columnstore*" + columnstore_version + "-" + columnstore_release + "*.bin.tar.gz";
if ( DistributedInstall == "y" )
{

View File

@ -23,6 +23,7 @@
#include <boost/scoped_ptr.hpp>
#include "columnstoreversion.h"
#include "IDBDataFile.h"
#include "IDBPolicy.h"
#include "processmonitor.h"
@ -110,18 +111,8 @@ MonitorConfig::MonitorConfig()
// }
//get calpont software version and release
SystemSoftware systemsoftware;
try
{
oam.getSystemSoftware(systemsoftware);
fsoftwareVersion = systemsoftware.Version;
fsoftwareRelease = systemsoftware.Release;
}
catch (exception& e) {
cout << endl << "ProcMon Construct Error reading getSystemSoftware = " << e.what() << endl;
}
fsoftwareVersion = columnstore_version;
fsoftwareRelease = columnstore_release;
}

View File

@ -1,48 +0,0 @@
#! /bin/sh
#
# $1 - release number or 'Latest' (default 'Latest')
#
if [ "$1" = "" ] ; then
DIR=Latest
REL="3.6-0"
elif [ "$1" = "Latest" ] ; then
DIR=Latest
REL="3.6-0"
elif [ "$2" = "" ] ; then
DIR=$1
REL=$1
else
DIR=$1
REL=$2
fi
#
if [[ $REL != *-* ]] ; then
REL=$REL"-0"
fi
#
{
cd /root/autoOAM/
rpm -e infinidb-libs infinidb-platform infinidb-enterprise --nodeps
rpm -e infinidb-storage-engine infinidb-mysql --nodeps
rpm -e infinidb-mysql --nodeps
rm -rf /usr/local/Calpont
rm -rf calpont*
rm -f *gz
#
smbclient //srvhill01/shared -WMARIADB -Uroot%Calpont1 -c "cd packages/$DIR;prompt OFF;mget *.rpm"
rpm -ivh calpont*.x86_64.rpm --nodeps
rpm -iq calpont >> /usr/local/Calpont/releasenum
cd /usr/local/
tar -zcvf calpont-infinidb-ent-$REL.x86_64.bin.tar.gz Calpont
mv calpont-infinidb-ent-$REL.x86_64.bin.tar.gz /root/autoOAM/
cd /root/autoOAM/
alien -ck calpont*.x86_64.rpm
tar -zcvf calpont-infinidb-ent-$REL.x86_64.rpm.tar.gz *$REL*.rpm
tar -zcvf calpont-infinidb-ent-$REL.amd64.deb.tar.gz *$REL*.deb
smbclient //srvhill01/shared -WMARIADB -Uroot%Calpont1 -c "cd packages/$DIR;mkdir packages;cd packages;prompt OFF;del calpont-infinidb-ent*gz;mput *gz"
} > /root/autoOAM/buildCalpontPackages-$DIR.log 2>&1
#
echo "Calpont Packages Build Successfully Completed"
exit 0

View File

@ -1,102 +0,0 @@
#! /bin/sh
#
# $Id: calpont-build 421 2007-14-15 15:46:55Z dhill $
#
# build calpont rpm and install on call6500
# $1 - release number or 'Latest'
# $2 - svn branch
#
if [ "$2" = "" ] ; then
echo "enter release and svn-branch arguments"
exit 0
fi
# !!! set for OS type 32 or 64 bit !!!
OS=x86_64
#
REL=$1
DIR=$2
#remove mysqld before new one is built
#prevents old version from being packaged in new build
rm -f /usr/local/Calpont/mysql/libexec/*
if [ $DIR = "genii" ] ; then
./mysql-build-genii > mysql-build-genii.log &
else
./mysql-build-branch $DIR > mysql-build-$DIR.log &
fi
#
HOME=/home/nightly/$DIR
rm -rf $HOME
rm -fr /home/nightly/rpm/
#
if [ $DIR = "genii" ] ; then
su - nightly -c "export CXXFLAGS='-O3 -fno-strict-aliasing ';mkdir $DIR;updateGenii.pl > ~/$DIR/updateGenii.log 2>&1;cd ~/$DIR;make clean;make > ~/$DIR/make.log 2>&1;make > ~/$DIR/make1.log 2>&1;./build/build_rpms > ~/$DIR/build_rpms.log 2>&1"
else
su - nightly -c "export CXXFLAGS='-O3 -fno-strict-aliasing ';mkdir $DIR;updateGenii.pl -b $DIR > ~/$DIR/updateGenii.log 2>&1;cd ~/$DIR;make clean;make > ~/$DIR/make.log 2>&1;make > ~/$DIR/make1.log 2>&1;./build/build_rpms > ~/$DIR/build_rpms.log 2>&1"
fi
#
# generate rpm info text files
if [ ! -f $HOME/build/releasenum ]; then
#default
version=3.0
else
. $HOME/build/releasenum
fi
cd /home/nightly/rpm/ > /dev/null 2>&1
cd RPMS/$OS/ > /dev/null 2>&1
test -f infinidb-platform-$version*.rpm || echo "no rpm"
test -f infinidb-platform-$version*.rpm || exit -1
rpm -qi -p infinidb-platform-$version*.rpm > infinidb-platform-$OS-rpm-info.txt
echo " " >> infinidb-platform-$OS-rpm-info.txt
echo "MD5SUM" >> infinidb-platform-$OS-rpm-info.txt
md5sum infinidb-platform-$version*.rpm >> infinidb-platform-$OS-rpm-info.txt
echo " " >> infinidb-platform-$OS-rpm-info.txt
#
test -f infinidb-storage-engine-*.rpm || echo "no rpm"
test -f infinidb-storage-engine-*.rpm || exit -1
rpm -qi -p infinidb-storage-engine-*.rpm > infinidb-storage-engine-$OS-rpm-info.txt
echo " " >> infinidb-storage-engine-$OS-rpm-info.txt
echo "MD5SUM" >> infinidb-storage-engine-$OS-rpm-info.txt
md5sum infinidb-storage-engine-*.rpm >> infinidb-storage-engine-$OS-rpm-info.txt
echo " " >> infinidb-storage-engine-$OS-rpm-info.txt
#
test -f infinidb-mysql-*.rpm || echo "no rpm"
test -f infinidb-mysql-*.rpm || exit -1
rpm -qi -p infinidb-mysql-*.rpm > infinidb-mysql-$OS-rpm-info.txt
echo " " >> infinidb-mysql-$OS-rpm-info.txt
echo "MD5SUM" >> infinidb-mysql-$OS-rpm-info.txt
md5sum infinidb-mysql-*.rpm >> infinidb-mysql-$OS-rpm-info.txt
echo " " >> infinidb-mysql-$OS-rpm-info.txt
#
{
if [ $REL != "Latest" ] ; then
# copy rpms to calweb
DATE=`date +%F`
cd /home/nightly/rpm/RPMS/$OS/
smbclient //calweb/shared -Wcalpont -Uoamuser%Calpont1 -c "cd Iterations;mkdir $REL;cd $REL;rm *.$OS.rpm;prompt OFF;mput *"
smbclient //calweb/shared -Wcalpont -Uoamuser%Calpont1 -c "cd Iterations/nightly;mkdir $REL-$DATE;cd $REL-$DATE;rm *.$OS.rpm;prompt OFF;mput *"
cd /home/nightly/$DIR/export/etc/
smbclient //calweb/shared -Wcalpont -Uoamuser%Calpont1 -c "cd Iterations/$REL;rm Columnstore.xml;prompt OFF;mput Columnstore.xml"
smbclient //calweb/shared -Wcalpont -Uoamuser%Calpont1 -c "cd Iterations/nightly/$REL-$DATE;rm Columnstore.xml;prompt OFF;mput Columnstore.xml"
else
# copy nightly on calweb
DATE=`date +%F`
cd /home/nightly/rpm/RPMS/$OS/
smbclient //calweb/shared -Wcalpont -Uoamuser%Calpont1 -c "cd Iterations/Latest;rm *.$OS.rpm;prompt OFF;mput *"
smbclient //calweb/shared -Wcalpont -Uoamuser%Calpont1 -c "cd Iterations/nightly;mkdir genii-$DATE;cd genii-$DATE;prompt OFF;mput *"
cd /home/nightly/$DIR/export/etc/
smbclient //calweb/shared -Wcalpont -Uoamuser%Calpont1 -c "cd Iterations/Latest;rm Columnstore.xml;prompt OFF;mput Columnstore.xml"
smbclient //calweb/shared -Wcalpont -Uoamuser%Calpont1 -c "cd Iterations/nightly/genii-$DATE;prompt OFF;mput Columnstore.xml"
fi
} 2> /root/infinidb-build-$REL-$DIR.log
#
echo "Build Successfully Completed"
exit 0

View File

@ -1,194 +0,0 @@
#!/usr/bin/expect
#
# $Id$
#
# Parent OAM Installer, copy RPM's and custom OS files from postConfigure script
# Argument 0 - Parent OAM IP address
# Argument 1 - Root Password of Parent OAM Module
# Argument 2 - Calpont Config File
# Argument 3 - Debug flag 1 for on, 0 for off
set SERVER [lindex $argv 0]
set PASSWORD [lindex $argv 1]
#set PACKAGE [lindex $argv 2]
set PACKAGE *.rpm
set RELEASE [lindex $argv 3]
set CONFIGFILE [lindex $argv 4]
set USERNAME [lindex $argv 5]
set CEFLAG [lindex $argv 6]
set PACKAGENAME [lindex $argv 7]
set INSTALLLOCATION [lindex $argv 8]
set DEBUG [lindex $argv 9]
set INSTALLDIR "/usr/local"
set SHARED "//srvhill01/shared"
log_user $DEBUG
spawn -noecho /bin/bash
set CONFIG "Calpont"
if { $PACKAGENAME != "columnstore"} {
set CONFIG "Calpont"
}
set timeout 10
send "ssh $USERNAME@$SERVER 'rm -f /root/Calpont-*.rpm /root/$PACKAGENAME*.rpm'\n"
expect {
-re "authenticity" { send "yes\n"
expect {
-re "word: " { send "$PASSWORD\n" }
}
}
-re "service not known" { send_user "FAILED: Invalid Host\n" ; exit -1 }
-re "word: " { send "$PASSWORD\n" }
}
expect {
-re {[$#] } { }
-re "Permission denied, please try again" { send_user "FAILED: Invalid password\n" ; exit -1 }
}
#
# erase InfiniDB packages
#
set timeout 60
send_user "Erase Old InfiniDB Packages "
send "ssh $USERNAME@$SERVER 'pkill -9 mysqld'\n"
expect -re "word: "
# password for ssh
send "$PASSWORD\n"
# check return
expect {
-re {[$#] } { }
}
send "ssh $USERNAME@$SERVER 'rpm -e --nodeps \$(rpm -qa | grep '^mariadb-columnstore') >/dev/null 2>&1; rpm -e --nodeps \$(rpm -qa | grep '^infinidb-')'\n"
expect -re "word: "
# password for ssh
send "$PASSWORD\n"
# check return
expect {
-re "uninstall completed" { }
-re {[$#] } { }
-re "not installed" { }
-re "Failed dependencies" { send_user "FAILED: Failed dependencies\n" ; exit -1 }
-re "Permission denied, please try again" { send_user "FAILED: Invalid password\n" ; exit -1 }
}
sleep 10
send "ssh $USERNAME@$SERVER 'rm -f $INSTALLDIR/$INSTALLLOCATION/releasenum >/dev/null 2>&1; test -x $INSTALLDIR/$INSTALLLOCATION/bin/pre-uninstall && $INSTALLDIR/$INSTALLLOCATION/bin/pre-uninstall'\n"
expect -re "word: "
# password for ssh
send "$PASSWORD\n"
# check return
expect {
-re {[$#] } { send_user "DONE" }
-re "uninstall completed" { send_user "DONE" }
-re "Failed dependencies" { send_user "FAILED: Failed dependencies\n" ; exit -1 }
-re "Permission denied, please try again" { send_user "FAILED: Invalid password\n" ; exit -1 }
}
send_user "\n"
sleep 5
#
# get the InfiniDB package
#
send_user "Get InfiniDB Packages "
send "smbclient $SHARED -WMARIADB -Uroot%Calpont1 -c 'cd packages/$RELEASE/;prompt OFF;mget $PACKAGE'\n"
expect {
-re "NT_STATUS_NO_SUCH_FILE" { send_user "FAILED: $PACKAGE not found\n" ; exit -1 }
-re "getting" { send_user "DONE" }
}
send_user "\n"
#
# send the InfiniDB package
#
set timeout 120
send_user "Copy InfiniDB Packages "
send "scp -q $PACKAGE $USERNAME@$SERVER:/root/.\n"
expect -re "word: "
# password for ssh
send "$PASSWORD\n"
expect {
-re {[$#] } { send_user "DONE" }
-re "scp" { send_user "FAILED: SCP failure\n" ; exit -1 }
-re "Permission denied, please try again" { send_user "FAILED: Invalid password\n" ; exit -1 }
-re "No such file or directory" { send_user "FAILED: Invalid package\n" ; exit -1 }
}
send_user "\n"
#send "rm -f $PACKAGE\n"
#
# install InfiniDB package
#
send_user "Install New InfiniDB Packages "
send "ssh $USERNAME@$SERVER ' rpm -iv --nodeps --force $PACKAGENAME-*'\n"
expect -re "word: "
# password for ssh
send "$PASSWORD\n"
# check return
expect {
-re "completed" { expect {
-re "completed" { expect {
-re "completed" { send_user "DONE" }
}
}
}
}
-re "Failed dependencies" { send_user "FAILED: Failed dependencies\n" ;
send_user "\n*** Installation Failed\n" ;
exit -1 }
-re "Permission denied, please try again" { send_user "FAILED: Invalid password\n" ; exit -1 }
}
send_user "\n"
set timeout 120
expect -re {[$#] }
#
if { $CONFIGFILE != "NULL"} {
#
# copy over Columnstore.xml file
#
send "scp $CONFIGFILE $USERNAME@$SERVER:/usr/local/$INSTALLLOCATION/etc/$CONFIG.xml\n"
expect -re "word: "
# send the password
send "$PASSWORD\n"
expect {
-re "100%" { }
-re "scp" { send_user "FAILED: SCP failure\n" ; exit -1 }
-re "Permission denied, please try again" { send_user "FAILED: Invalid password\n" ; exit -1 }
-re "No such file or directory" { send_user "FAILED: Invalid package\n" ; exit -1 }
}
send_user "Copy InfiniDB Configuration File "
send "scp $CONFIGFILE $USERNAME@$SERVER:/usr/local/$INSTALLLOCATION/etc/$CONFIG.xml.rpmsave\n"
expect -re "word: "
# send the password
send "$PASSWORD\n"
expect {
-re "100%" { send_user "DONE"}
-re "scp" { send_user "FAILED: SCP failure\n" ; exit -1 }
-re "Permission denied, please try again" { send_user "FAILED: Invalid password\n" ; exit -1 }
-re "No such file or directory" { send_user "FAILED: Invalid package\n" ; exit -1 }
}
#do a dummy scp command
send "scp $CONFIGFILE $USERNAME@$SERVER:/tmp/$CONFIG.xml\n"
expect -re "word: "
# send the password
send "$PASSWORD\n"
expect {
-re "100%" { send_user " " }
}
} else {
#
# rename previous installed config file
#
send_user "Copy RPM-saved InfiniDB Configuration File "
send "ssh $USERNAME@$SERVER 'cd /usr/local/$INSTALLLOCATION/etc/;mv -f Columnstore.xml Columnstore.xml.install;cp -v Columnstore.xml.rpmsave Columnstore.xml'\n"
expect -re "word: "
# password for ssh
send "$PASSWORD\n"
# check return
expect {
-re "Columnstore.xml" { send_user "DONE" }
-re "Permission denied, please try again" { send_user "FAILED: Invalid password\n" ; exit -1 }
}
}
send_user "\n"
#
exit

View File

@ -1,191 +0,0 @@
#!/usr/bin/expect
#
# $Id: parent_installer.sh 421 2007-04-05 15:46:55Z dhill $
#
# Parent OAM Installer, copy RPM's and custom OS files from postConfigure script
# Argument 0 - Parent OAM IP address
# Argument 1 - Root Password of Parent OAM Module
# Argument 2 - Calpont Config File
# Argument 3 - Debug flag 1 for on, 0 for off
set SERVER [lindex $argv 0]
set PASSWORD [lindex $argv 1]
set PACKAGE [lindex $argv 2]
set RELEASE [lindex $argv 3]
set CONFIGFILE [lindex $argv 4]
set USERNAME [lindex $argv 5]
set CEFLAG [lindex $argv 6]
set DEBUG [lindex $argv 7]
set CALPONTPACKAGE calpont-$PACKAGE
set MYSQLPACKAGE calpont-mysql-$PACKAGE
set MYSQLDPACKAGE calpont-mysqld-$PACKAGE
set INSTALLDIR "/usr/local"
#set SHARED "//cal6500/shared"
set SHARED "//calweb/shared"
log_user $DEBUG
spawn -noecho /bin/bash
send "rm -f $CALPONTPACKAGE\n"
#
# delete and erase all old packages from Director Module
#
set timeout 10
send "ssh $USERNAME@$SERVER 'rm -f /root/$CALPONTPACKAGE'\n"
expect {
-re "authenticity" { send "yes\n"
expect {
-re "word: " { send "$PASSWORD\n" } abort
}
}
-re "service not known" { send_user "FAILED: Invalid Host\n" ; exit -1 }
-re "word: " { send "$PASSWORD\n" } abort
}
expect {
-re "#" { } abort
-re "Permission denied, please try again" { send_user "FAILED: Invalid password\n" ; exit -1 }
}
#
# erase calpont packages
#
set timeout 60
send_user "Erase Old Calpont Packages "
send "ssh $USERNAME@$SERVER 'pkill -9 mysqld'\n"
expect -re "word: "
# password for ssh
send "$PASSWORD\n"
# check return
expect {
-re "# " { } abort
}
send "ssh $USERNAME@$SERVER 'rpm -e --nodeps \$(rpm -qa | grep '^calpont') >/dev/null 2>&1; rpm -e --nodeps \$(rpm -qa | grep '^infinidb-')'\n"
expect -re "word: "
# password for ssh
send "$PASSWORD\n"
# check return
expect {
-re "uninstall completed" { } abort
-re "# " { } abort
-re "not installed" { } abort
-re "Failed dependencies" { send_user "FAILED: Failed dependencies\n" ; exit -1 }
-re "Permission denied, please try again" { send_user "FAILED: Invalid password\n" ; exit -1 }
}
sleep 10
send "ssh $USERNAME@$SERVER 'rm -f $INSTALLDIR/Calpont/releasenum >/dev/null 2>&1; test -x $INSTALLDIR/Calpont/bin/pre-uninstall && $INSTALLDIR/Calpont/bin/pre-uninstall'\n"
expect -re "word: "
# password for ssh
send "$PASSWORD\n"
# check return
expect {
-re "# " { send_user "DONE" } abort
-re "uninstall completed" { send_user "DONE" } abort
-re "Failed dependencies" { send_user "FAILED: Failed dependencies\n" ; exit -1 }
-re "Permission denied, please try again" { send_user "FAILED: Invalid password\n" ; exit -1 }
}
send_user "\n"
sleep 5
#
# get the calpont package
#
send_user "Get Calpont Packages "
send "smbclient $SHARED -Wcalpont -Uoamuser%Calpont1 -c 'cd Iterations/$RELEASE/;prompt OFF;mget $PACKAGE'\n"
expect {
-re "NT_STATUS_NO_SUCH_FILE" { send_user "FAILED: $PACKAGE not found\n" ; exit -1 }
-re "getting" { send_user "DONE" } abort
}
send_user "\n"
#
# send the calpont package
#
send_user "Copy Calpont Packages "
send "scp -q $PACKAGE $USERNAME@$SERVER:/root/.\n"
expect -re "word: "
# password for ssh
send "$PASSWORD\n"
expect {
-re "#" { send_user "DONE" } abort
-re "scp" { send_user "FAILED: SCP failure\n" ; exit -1 }
-re "Permission denied, please try again" { send_user "FAILED: Invalid password\n" ; exit -1 }
-re "No such file or directory" { send_user "FAILED: Invalid package\n" ; exit -1 }
}
send_user "\n"
#send "rm -f $PACKAGE\n"
#
# install calpont package
#
set timeout 120
send_user "Install New Calpont Packages "
send "ssh $USERNAME@$SERVER ' rpm -iv --nodeps /root/$CALPONTPACKAGE'\n"
expect -re "word: "
# password for ssh
send "$PASSWORD\n"
# check return
expect {
-re "completed" { expect {
-re "completed" { expect {
-re "completed" { send_user "DONE" } abort
}
}
}
}
-re "Failed dependencies" { send_user "FAILED: Failed dependencies\n" ;
send_user "\n*** Installation Failed\n" ;
exit -1 }
-re "Permission denied, please try again" { send_user "FAILED: Invalid password\n" ; exit -1 }
}
send_user "\n"
set timeout 120
expect -re "# "
#
if { $CONFIGFILE != "NULL"} {
#
# copy over Columnstore.xml file
#
send_user "Copy Calpont Configuration File "
send "scp $CONFIGFILE $USERNAME@$SERVER:/usr/local/mariadb/columnstore/etc/Columnstore.xml.rpmsave\n"
expect -re "word: "
# send the password
send "$PASSWORD\n"
expect {
-re "100%" { } abort
-re "scp" { send_user "FAILED: SCP failure\n" ; exit -1 }
-re "Permission denied, please try again" { send_user "FAILED: Invalid password\n" ; exit -1 }
-re "No such file or directory" { send_user "FAILED: Invalid package\n" ; exit -1 }
}
send "scp $CONFIGFILE $USERNAME@$SERVER:/usr/local/mariadb/columnstore/etc/Columnstore.xml\n"
expect -re "word: "
# send the password
send "$PASSWORD\n"
expect {
-re "100%" { send_user "DONE" } abort
-re "scp" { send_user "FAILED: SCP failure\n" ; exit -1 }
-re "Permission denied, please try again" { send_user "FAILED: Invalid password\n" ; exit -1 }
-re "No such file or directory" { send_user "FAILED: Invalid package\n" ; exit -1 }
}
send "scp $CONFIGFILE $USERNAME@$SERVER:/tmp/Columnstore.xml\n"
expect -re "word: "
# send the password
send "$PASSWORD\n"
expect {
-re "100%" { send_user " " } abort
}
} else {
#
# rename previous installed config file
#
send_user "Copy RPM-saved Calpont Configuration File "
send "ssh $USERNAME@$SERVER 'cd /usr/local/mariadb/columnstore/etc/;mv -f Columnstore.xml Columnstore.xml.install;cp -v Columnstore.xml.rpmsave Columnstore.xml'\n"
expect -re "word: "
# password for ssh
send "$PASSWORD\n"
# check return
expect {
-re "Columnstore.xml" { send_user "DONE" } abort
-re "Permission denied, please try again" { send_user "FAILED: Invalid password\n" ; exit -1 }
}
}
send_user "\n"
#
exit

View File

@ -1,215 +0,0 @@
#!/usr/bin/expect
#
# $Id: parent_installer.sh 421 2007-04-05 15:46:55Z dhill $
#
# Parent OAM Installer, copy RPM's and custom OS files from postConfigure script
# Argument 0 - Parent OAM IP address
# Argument 1 - Root Password of Parent OAM Module
# Argument 2 - Calpont Config File
# Argument 3 - Debug flag 1 for on, 0 for off
set SERVER [lindex $argv 0]
set PASSWORD [lindex $argv 1]
set PACKAGE [lindex $argv 2]
set RELEASE [lindex $argv 3]
set CONFIGFILE [lindex $argv 4]
set USERNAME [lindex $argv 5]
set INSTALLDIR [lindex $argv 6]
set PACKAGENAME [lindex $argv 7]
set INSTALLLOCATION [lindex $argv 8]
set DEBUG [lindex $argv 9]
set CALPONTPACKAGE infinidb-ent-*$PACKAGE
set SHARED "//srvhill01/shared"
set INSTALLDIRARG " "
set HOME "/root"
if { $USERNAME != "root" } {
set INSTALLDIRARG "--installdir=$INSTALLDIR/$INSTALLLOCATION"
set HOME $INSTALLDIR
}
log_user $DEBUG
spawn -noecho /bin/bash
send "rm -f $PACKAGE\n"
#
# delete binary package on Parent OAM Module
#
set timeout 30
send_user "Remove Calpont Packages from System "
send "ssh $USERNAME@$SERVER 'rm -f $INSTALLDIR/$INSTALLLOCATION*.gz;rm -f /root/$INSTALLLOCATION*.rpm;rm -f /root/$INSTALLLOCATION*.gz'\n"
expect {
-re "authenticity" { send "yes\n"
expect {
-re "word: " { send "$PASSWORD\n" } abort
}
}
-re "service not known" { send_user "FAILED: Invalid Host\n" ; exit -1 }
-re "word: " { send "$PASSWORD\n" } abort
}
expect {
-re "Permission denied, please try again" { send_user "FAILED: Invalid password\n" ; exit -1 }
}
send_user "DONE\n"
#
# get the calpont package
#
send_user "Get Calpont Packages "
send "smbclient $SHARED -WMARIADB -Uroot%Calpont1 -c 'cd packages/$RELEASE/packages;prompt OFF;mget $PACKAGE'\n"
expect {
-re "NT_STATUS_NO_SUCH_FILE" { send_user "FAILED: $PACKAGE not found\n" ; exit -1 }
-re "getting" { send_user "DONE" } abort
}
send_user "\n"
#
# send the calpont package
#
send_user "Copy Calpont Packages "
send "scp $PACKAGE $USERNAME@$SERVER:$HOME/.\n"
expect -re "word: "
# password for ssh
send "$PASSWORD\n"
expect {
-re "100%" { send_user "DONE" } abort
-re "scp" { send_user "FAILED\n" ;
send_user "\n*** Installation Failed\n" ;
exit -1 }
-re "Permission denied, please try again" { send_user "FAILED: Invalid password\n" ; exit -1 }
-re "No such file or directory" { send_user "FAILED: Invalid package\n" ; exit -1 }
}
send_user "\n"
#
# uninstall calpont package
#
send_user "Erase Old Calpont Package "
send "ssh $USERNAME@$SERVER 'pkill -9 mysqld'\n"
expect -re "word: "
# password for ssh
send "$PASSWORD\n"
# check return
expect {
-re "# " { } abort
}
send "ssh $USERNAME@$SERVER 'rpm -e --nodeps \$(rpm -qa | grep '^calpont') >/dev/null 2>&1; rpm -e --nodeps \$(rpm -qa | grep '^infinidb-')'\n"
expect -re "word: "
# password for ssh
send "$PASSWORD\n"
# check return
expect {
-re "uninstall completed" { } abort
-re "# " { } abort
-re "not installed" { } abort
-re "Failed dependencies" { } abort
-re "Permission denied, please try again" { send_user "FAILED: Invalid password\n" ; exit -1 }
}
sleep 10
send "ssh $USERNAME@$SERVER 'rm -f $INSTALLDIR/$INSTALLLOCATION/releasenum >/dev/null 2>&1; test -x $INSTALLDIR/$INSTALLLOCATION/bin/pre-uninstall && $INSTALLDIR/$INSTALLLOCATION/bin/pre-uninstall $INSTALLDIRARG'\n"
expect -re "word: "
# password for ssh
send "$PASSWORD\n"
# check return
expect {
-re "# " { send_user "DONE" } abort
-re "uninstall completed" { send_user "DONE" } abort
-re "Failed dependencies" { send_user "FAILED: Failed dependencies\n" ; exit -1 }
-re "Permission denied, please try again" { send_user "FAILED: Invalid password\n" ; exit -1 }
}
send_user "\n"
sleep 5
#
# install calpont package
#
set timeout 30
send_user "Install New Calpont Package "
send "ssh $USERNAME@$SERVER 'tar -C $INSTALLDIR --exclude db -zxf $HOME/$CALPONTPACKAGE;cat $INSTALLDIR/$INSTALLLOCATION/releasenum'\n"
expect -re "word: "
# password for ssh
send "$PASSWORD\n"
# check return
expect {
-re "completed" { send_user "DONE" } abort
-re "release=" { send_user "DONE" } abort
-re "Failed dependencies" { send_user "FAILED: Failed dependencies\n" ;
send_user "\n*** Installation Failed\n" ;
exit -1 }
-re "Permission denied, please try again" { send_user "FAILED: Invalid password\n" ; exit -1 }
-re "exiting now" { send_user "FAILED: Error in tar command\n" ; exit -1 }
}
send_user "\n"
set timeout 30
send "rm -f $PACKAGE\n"
#
send_user "Run post-install script "
send " \n"
send date\n
send "ssh $USERNAME@$SERVER '$INSTALLDIR/$INSTALLLOCATION/bin/post-install $INSTALLDIRARG'\n"
set timeout 10
expect {
-re "word: " { send "$PASSWORD\n" } abort
-re "passphrase" { send "$PASSWORD\n" } abort
}
set timeout 60
# check return
expect {
-re "InfiniDB syslog logging not working" { send_user "ERROR: InfiniDB System logging not setup\n" ; exit 1 }
-re "Permission denied, please try again" { send_user "ERROR: Invalid password\n" ; exit 1 }
-re "Read-only file system" { send_user "ERROR: local disk - Read-only file system\n" ; exit 1}
-re "Connection refused" { send_user "ERROR: Connection refused\n" ; exit 1 }
-re "closed" { send_user "ERROR: Connection closed\n" ; exit 1 }
-re "No route to host" { send_user "ERROR: No route to host\n" ; exit 1 }
-re "postConfigure" { send_user "DONE" } abort
-re "# " { send_user "DONE" } abort
}
send_user "\n"
sleep 10
#
if { $CONFIGFILE != "NULL"} {
#
# copy over $CONFIG.xml file
#
send_user "Copy Calpont Configuration File "
send "scp $CONFIGFILE $USERNAME@$SERVER:$INSTALLDIR/$INSTALLLOCATION/etc/$CONFIG.xml.rpmsave\n"
expect -re "word: "
# send the password
send "$PASSWORD\n"
expect {
-re "100%" { } abort
-re "scp" { send_user "FAILED\n" ;
send_user "\n*** Installation Failed\n" ;
exit -1 }
-re "Permission denied, please try again" { send_user "FAILED: Invalid password\n" ; exit -1 }
-re "No such file or directory" { send_user "FAILED: Invalid package\n" ; exit -1 }
}
send "scp $CONFIGFILE $USERNAME@$SERVER:$INSTALLDIR/$INSTALLLOCATION/etc/$CONFIG.xml\n"
expect -re "word: "
# send the password
send "$PASSWORD\n"
expect {
-re "100%" { send_user "DONE" } abort
-re "scp" { send_user "FAILED\n" ;
send_user "\n*** Installation Failed\n" ;
exit -1 }
-re "Permission denied, please try again" { send_user "FAILED: Invalid password\n" ; exit -1 }
-re "No such file or directory" { send_user "FAILED: Invalid package\n" ; exit -1 }
}
} else {
#
# rename previous installed config file
#
send_user "Copy RPM-saved Calpont Configuration File "
send "ssh $USERNAME@$SERVER 'cd $INSTALLDIR/$INSTALLLOCATION/etc/;mv -f $CONFIG.xml $CONFIG.xml.install;cp -v $CONFIG.xml.rpmsave $CONFIG.xml'\n"
expect -re "word: "
# password for ssh
send "$PASSWORD\n"
# check return
expect {
-re "$CONFIG.xml" { send_user "DONE" } abort
-re "Permission denied, please try again" { send_user "FAILED: Invalid password\n" ; exit -1 }
}
}
send_user "\n"
#
exit

View File

@ -1,212 +0,0 @@
#!/usr/bin/expect
#
# $Id: parent_installer.sh 421 2007-04-05 15:46:55Z dhill $
#
# Parent OAM Installer, copy RPM's and custom OS files from postConfigure script
# Argument 0 - Parent OAM IP address
# Argument 1 - Root Password of Parent OAM Module
# Argument 2 - Calpont Config File
# Argument 3 - Debug flag 1 for on, 0 for off
set SERVER [lindex $argv 0]
set PASSWORD [lindex $argv 1]
set PACKAGE [lindex $argv 2]
set RELEASE [lindex $argv 3]
set CONFIGFILE [lindex $argv 4]
set USERNAME [lindex $argv 5]
set INSTALLDIR [lindex $argv 6]
set DEBUG [lindex $argv 7]
set CALPONTPACKAGE calpont-infinidb-ent-*$PACKAGE
set SHARED "//calweb/shared"
set INSTALLDIRARG " "
set HOME "/root"
if { $USERNAME != "root" } {
set INSTALLDIRARG "--installdir=$INSTALLDIR/Calpont"
set HOME $INSTALLDIR
}
log_user $DEBUG
spawn -noecho /bin/bash
send "rm -f $PACKAGE\n"
#
# delete binary package on Parent OAM Module
#
set timeout 30
send_user "Remove Calpont Packages from System "
send "ssh $USERNAME@$SERVER 'rm -f $INSTALLDIR/calpont*.gz;rm -f /root/calpont*.rpm;rm -f /root/calpont*.gz'\n"
expect {
-re "authenticity" { send "yes\n"
expect {
-re "word: " { send "$PASSWORD\n" } abort
}
}
-re "service not known" { send_user "FAILED: Invalid Host\n" ; exit -1 }
-re "word: " { send "$PASSWORD\n" } abort
}
expect {
-re "Permission denied, please try again" { send_user "FAILED: Invalid password\n" ; exit -1 }
}
send_user "DONE\n"
#
# get the calpont package
#
send_user "Get Calpont Packages "
send "smbclient $SHARED -Wcalpont -Uoamuser%Calpont1 -c 'cd Iterations/$RELEASE/packages;prompt OFF;mget $PACKAGE'\n"
expect {
-re "NT_STATUS_NO_SUCH_FILE" { send_user "FAILED: $PACKAGE not found\n" ; exit -1 }
-re "getting" { send_user "DONE" } abort
}
send_user "\n"
#
# send the calpont package
#
send_user "Copy Calpont Packages "
send "scp $PACKAGE $USERNAME@$SERVER:$HOME/.\n"
expect -re "word: "
# password for ssh
send "$PASSWORD\n"
expect {
-re "100%" { send_user "DONE" } abort
-re "scp" { send_user "FAILED\n" ;
send_user "\n*** Installation Failed\n" ;
exit -1 }
-re "Permission denied, please try again" { send_user "FAILED: Invalid password\n" ; exit -1 }
-re "No such file or directory" { send_user "FAILED: Invalid package\n" ; exit -1 }
}
send_user "\n"
#
# uninstall calpont package
#
send_user "Erase Old Calpont Package "
send "ssh $USERNAME@$SERVER 'pkill -9 mysqld'\n"
expect -re "word: "
# password for ssh
send "$PASSWORD\n"
# check return
expect {
-re "# " { } abort
}
send "ssh $USERNAME@$SERVER 'rpm -e --nodeps \$(rpm -qa | grep '^calpont') >/dev/null 2>&1; rpm -e --nodeps \$(rpm -qa | grep '^infinidb-')'\n"expect -re "word: "
# password for ssh
send "$PASSWORD\n"
# check return
expect {
-re "uninstall completed" { } abort
-re "# " { } abort
-re "not installed" { } abort
-re "Failed dependencies" { } abort
-re "Permission denied, please try again" { send_user "FAILED: Invalid password\n" ; exit -1 }
}
sleep 10
send "ssh $USERNAME@$SERVER 'rm -f $INSTALLDIR/Calpont/releasenum >/dev/null 2>&1; test -x $INSTALLDIR/Calpont/bin/pre-uninstall && $INSTALLDIR/Calpont/bin/pre-uninstall $INSTALLDIRARG'\n"
expect -re "word: "
# password for ssh
send "$PASSWORD\n"
# check return
expect {
-re "# " { send_user "DONE" } abort
-re "uninstall completed" { send_user "DONE" } abort
-re "Failed dependencies" { send_user "FAILED: Failed dependencies\n" ; exit -1 }
-re "Permission denied, please try again" { send_user "FAILED: Invalid password\n" ; exit -1 }
}
send_user "\n"
sleep 5
#
# install calpont package
#
set timeout 30
send_user "Install New Calpont Package "
send "ssh $USERNAME@$SERVER 'tar -C $INSTALLDIR --exclude db -zxf $HOME/$CALPONTPACKAGE;cat $INSTALLDIR/Calpont/releasenum'\n"
expect -re "word: "
# password for ssh
send "$PASSWORD\n"
# check return
expect {
-re "completed" { send_user "DONE" } abort
-re "release=" { send_user "DONE" } abort
-re "Failed dependencies" { send_user "FAILED: Failed dependencies\n" ;
send_user "\n*** Installation Failed\n" ;
exit -1 }
-re "Permission denied, please try again" { send_user "FAILED: Invalid password\n" ; exit -1 }
-re "exiting now" { send_user "FAILED: Error in tar command\n" ; exit -1 }
}
send_user "\n"
set timeout 30
send "rm -f $PACKAGE\n"
#
send_user "Run post-install script "
send " \n"
send date\n
send "ssh $USERNAME@$SERVER '$INSTALLDIR/Calpont/bin/post-install $INSTALLDIRARG'\n"
set timeout 10
expect {
-re "word: " { send "$PASSWORD\n" } abort
-re "passphrase" { send "$PASSWORD\n" } abort
}
set timeout 60
# check return
expect {
-re "InfiniDB syslog logging not working" { send_user "ERROR: InfiniDB System logging not setup\n" ; exit 1 }
-re "Permission denied, please try again" { send_user "ERROR: Invalid password\n" ; exit 1 }
-re "Read-only file system" { send_user "ERROR: local disk - Read-only file system\n" ; exit 1}
-re "Connection refused" { send_user "ERROR: Connection refused\n" ; exit 1 }
-re "closed" { send_user "ERROR: Connection closed\n" ; exit 1 }
-re "No route to host" { send_user "ERROR: No route to host\n" ; exit 1 }
-re "postConfigure" { send_user "DONE" } abort
-re "# " { send_user "DONE" } abort
}
send_user "\n"
sleep 10
#
if { $CONFIGFILE != "NULL"} {
#
# copy over Columnstore.xml file
#
send_user "Copy Calpont Configuration File "
send "scp $CONFIGFILE $USERNAME@$SERVER:$INSTALLDIR/Calpont/etc/Columnstore.xml.rpmsave\n"
expect -re "word: "
# send the password
send "$PASSWORD\n"
expect {
-re "100%" { } abort
-re "scp" { send_user "FAILED\n" ;
send_user "\n*** Installation Failed\n" ;
exit -1 }
-re "Permission denied, please try again" { send_user "FAILED: Invalid password\n" ; exit -1 }
-re "No such file or directory" { send_user "FAILED: Invalid package\n" ; exit -1 }
}
send "scp $CONFIGFILE $USERNAME@$SERVER:$INSTALLDIR/Calpont/etc/Columnstore.xml\n"
expect -re "word: "
# send the password
send "$PASSWORD\n"
expect {
-re "100%" { send_user "DONE" } abort
-re "scp" { send_user "FAILED\n" ;
send_user "\n*** Installation Failed\n" ;
exit -1 }
-re "Permission denied, please try again" { send_user "FAILED: Invalid password\n" ; exit -1 }
-re "No such file or directory" { send_user "FAILED: Invalid package\n" ; exit -1 }
}
} else {
#
# rename previous installed config file
#
send_user "Copy RPM-saved Calpont Configuration File "
send "ssh $USERNAME@$SERVER 'cd $INSTALLDIR/Calpont/etc/;mv -f Columnstore.xml Columnstore.xml.install;cp -v Columnstore.xml.rpmsave Columnstore.xml'\n"
expect -re "word: "
# password for ssh
send "$PASSWORD\n"
# check return
expect {
-re "Columnstore.xml" { send_user "DONE" } abort
-re "Permission denied, please try again" { send_user "FAILED: Invalid password\n" ; exit -1 }
}
}
send_user "\n"
#
exit

View File

@ -1,188 +0,0 @@
#!/usr/bin/expect
#
# $Id: parent_installer.sh 421 2007-04-05 15:46:55Z dhill $
#
# Parent OAM Installer, copy RPM's and custom OS files from postConfigure script
# Argument 0 - Parent OAM IP address
# Argument 1 - Root Password of Parent OAM Module
# Argument 2 - Calpont Config File
# Argument 3 - Debug flag 1 for on, 0 for off
set USERNAME root
set SERVER [lindex $argv 0]
set PASSWORD [lindex $argv 1]
#set PACKAGE [lindex $argv 2]
set PACKAGE *.rpm
set RELEASE [lindex $argv 3]
set CONFIGFILE [lindex $argv 4]
set PREFIX [lindex $argv 5]
set USERNAME [lindex $argv 6]
set PACKAGENAME [lindex $argv 7]
set INSTALLLOCATION [lindex $argv 8]
set DEBUG [lindex $argv 9]
set SHARED "//srvhill01/shared"
set INSTALLDIR "/usr/local"
log_user $DEBUG
spawn -noecho /bin/bash
set CONFIG "Calpont"
if { $PACKAGENAME != "columnstore"} {
set CONFIG "Calpont"
}
send "rm -f $PACKAGE\n"
#
# delete and erase all old packages from Parent OAM Module
#
set timeout 30
send "ssh $USERNAME@$SERVER 'rm -f /root/Calpont-*.rpm /root/$PACKAGENAME*.rpm /root/mariadb*.rpm '\n"
expect {
-re "authenticity" { send "yes\n"
expect {
-re "word: " { send "$PASSWORD\n" }
}
}
-re "service not known" { send_user "FAILED: Invalid Host\n" ; exit -1 }
-re "word: " { send "$PASSWORD\n" }
}
expect {
-re {[$#] } { }
-re "Permission denied, please try again" { send_user "FAILED: Invalid password\n" ; exit -1 }
}
#
# get the InfiniDB package
#
expect -re {[$#] }
send_user "Get InfiniDB Packages "
send "smbclient $SHARED -WMARIADB -Uroot%Calpont1 -c 'cd packages/$RELEASE/;prompt OFF;mget $PACKAGE'\n"
expect {
-re "NT_STATUS_NO_SUCH_FILE" { send_user "FAILED: $PACKAGE not found\n" ; exit -1 }
-re "getting" { send_user "DONE" }
}
send_user "\n"
#
# send the InfiniDB package
#
set timeout 120
send_user "Copy InfiniDB Packages "
send "scp -q $PACKAGE $USERNAME@$SERVER:/root/.\n"
expect -re "word: "
# password for ssh
send "$PASSWORD\n"
expect {
-re {[$#] } { send_user "DONE" }
-re "scp" { send_user "FAILED: SCP failure\n" ; exit -1 }
-re "Permission denied, please try again" { send_user "FAILED: Invalid password\n" ; exit -1 }
-re "No such file or directory" { send_user "FAILED: Invalid package\n" ; exit -1 }
}
send_user "\n"
#send "rm -f $PACKAGE\n"
#
# erase InfiniDB package
#
set timeout 60
expect -re {[$#] }
send_user "Erase Old InfiniDB Package "
send "ssh $USERNAME@$SERVER 'rpm -e --nodeps \$(rpm -qa | grep '^mariadb-columnstore') >/dev/null 2>&1; rpm -e --nodeps \$(rpm -qa | grep '^infinidb-')'\n"
expect -re "word: "
# password for ssh
send "$PASSWORD\n"
# check return
expect {
-re "uninstall completed" { }
-re {[$#] } { }
-re "Failed dependencies" { send_user "FAILED: Failed dependencies\n" ; exit -1 }
-re "Permission denied, please try again" { send_user "FAILED: Invalid password\n" ; exit -1 }
}
sleep 10
send "ssh $USERNAME@$SERVER 'rm -f $INSTALLDIR/$INSTALLLOCATION/releasenum >/dev/null 2>&1; test -x $INSTALLDIR/$INSTALLLOCATION/bin/pre-uninstall && $INSTALLDIR/$INSTALLLOCATION/bin/pre-uninstall'\n"
expect -re "word: "
# password for ssh
send "$PASSWORD\n"
# check return
expect {
-re {[$#] } { send_user "DONE" }
-re "uninstall completed" { send_user "DONE" }
-re "Failed dependencies" { send_user "FAILED: Failed dependencies\n" ; exit -1 }
-re "Permission denied, please try again" { send_user "FAILED: Invalid password\n" ; exit -1 }
}
send_user "\n"
sleep 5
#
# install InfiniDB package
#
set timeout 160
send_user "Install New InfiniDB Packages "
send "ssh $USERNAME@$SERVER ' rpm -ivh --nodeps --force $PACKAGENAME-*'\n"
expect -re "word: "
# password for ssh
send "$PASSWORD\n"
# check return
expect {
-re "completed" { send_user "DONE" }
-re "Failed dependencies" { send_user "FAILED: Failed dependencies\n" ;
send_user "\n*** Installation Failed\n" ;
exit -1 }
-re "Permission denied, please try again" { send_user "FAILED: Invalid password\n" ; exit -1 }
-re "File not found" { send_user "FAILED: File not found\n" ; exit -1 }
}
send_user "\n"
set timeout 120
expect -re {[$#] }
send "rm -f $PACKAGE\n"
#
if { $CONFIGFILE != "NULL"} {
send "scp $CONFIGFILE $USERNAME@$SERVER:/usr/local/$INSTALLLOCATION/etc/$CONFIG.xml\n"
expect -re "word: "
# send the password
send "$PASSWORD\n"
expect {
-re "100%" { }
-re "scp" { send_user "FAILED: SCP failure\n" ; exit -1 }
-re "Permission denied, please try again" { send_user "FAILED: Invalid password\n" ; exit -1 }
-re "No such file or directory" { send_user "FAILED: Invalid package\n" ; exit -1 }
}
#
# copy over $CONFIG.xml file
#
send_user "Copy InfiniDB Configuration File "
send "scp $CONFIGFILE $USERNAME@$SERVER:/usr/local/$INSTALLLOCATION/etc/$CONFIG.xml.rpmsave\n"
expect -re "word: "
# send the password
send "$PASSWORD\n"
expect {
-re "100%" { send_user "DONE" }
-re "scp" { send_user "FAILED: SCP failure\n" ; exit -1 }
-re "Permission denied, please try again" { send_user "FAILED: Invalid password\n" ; exit -1 }
-re "No such file or directory" { send_user "FAILED: Invalid package\n" ; exit -1 }
}
#do a dummy scp command
send "scp $CONFIGFILE $USERNAME@$SERVER:/tmp/$CONFIG.xml\n"
expect -re "word: "
# send the password
send "$PASSWORD\n"
expect {
-re "100%" { send_user " " }
}
} else {
#
# rename previous installed config file
#
send_user "Copy RPM-saved InfiniDB Configuration File "
send "ssh $USERNAME@$SERVER 'cd /usr/local/$INSTALLLOCATION/etc/;mv -f $CONFIG.xml $CONFIG.xml.install;cp -v $CONFIG.xml.rpmsave $CONFIG.xml'\n"
expect -re "word: "
# password for ssh
send "$PASSWORD\n"
# check return
expect {
-re "$CONFIG.xml" { send_user "DONE" }
-re "Permission denied, please try again" { send_user "FAILED: Invalid password\n" ; exit -1 }
}
}
send_user "\n"
expect -re {[$#] }
#
exit

View File

@ -1,179 +0,0 @@
#!/usr/bin/expect
#
# $Id: parent_installer.sh 421 2007-04-05 15:46:55Z dhill $
#
# Parent OAM Installer, copy RPM's and custom OS files from postConfigure script
# Argument 0 - Parent OAM IP address
# Argument 1 - Root Password of Parent OAM Module
# Argument 2 - Calpont Config File
# Argument 3 - Debug flag 1 for on, 0 for off
set USERNAME root
set SERVER [lindex $argv 0]
set PASSWORD [lindex $argv 1]
set PACKAGE [lindex $argv 2]
set RELEASE [lindex $argv 3]
set CONFIGFILE [lindex $argv 4]
set PREFIX [lindex $argv 5]
set USERNAME [lindex $argv 6]
set DEBUG [lindex $argv 7]
set CALPONTPACKAGE calpont-$PREFIX$PACKAGE
set MYSQLPACKAGE calpont-mysql-$PACKAGE
set MYSQLDPACKAGE calpont-mysqld-$PACKAGE
#set SHARED "//cal6500/shared"
set SHARED "//calweb/shared"
set INSTALLDIR "/usr/local"
log_user $DEBUG
spawn -noecho /bin/bash
send "rm -f $PACKAGE\n"
#
# delete and erase all old packages from Parent OAM Module
#
set timeout 30
send "ssh $USERNAME@$SERVER 'rm -f /root/calpont*.rpm /root/infinidb*.rpm'\n"
expect {
-re "authenticity" { send "yes\n"
expect {
-re "word: " { send "$PASSWORD\n" } abort
}
}
-re "service not known" { send_user "FAILED: Invalid Host\n" ; exit -1 }
-re "word: " { send "$PASSWORD\n" } abort
}
expect {
-re "#" { } abort
-re "Permission denied, please try again" { send_user "FAILED: Invalid password\n" ; exit -1 }
}
#
# get the calpont package
#
expect -re "# "
send_user "Get Calpont Packages "
send "smbclient $SHARED -Wcalpont -Uoamuser%Calpont1 -c 'cd Iterations/$RELEASE/;prompt OFF;mget $PACKAGE'\n"
expect {
-re "NT_STATUS_NO_SUCH_FILE" { send_user "FAILED: $PACKAGE not found\n" ; exit -1 }
-re "getting" { send_user "DONE" } abort
}
send_user "\n"
#
# send the calpont package
#
send_user "Copy Calpont Packages "
send "scp -q $PACKAGE $USERNAME@$SERVER:/root/.\n"
expect -re "word: "
# password for ssh
send "$PASSWORD\n"
expect {
-re "#" { send_user "DONE" } abort
-re "scp" { send_user "FAILED: SCP failure\n" ; exit -1 }
-re "Permission denied, please try again" { send_user "FAILED: Invalid password\n" ; exit -1 }
-re "No such file or directory" { send_user "FAILED: Invalid package\n" ; exit -1 }
}
send_user "\n"
#send "rm -f $PACKAGE\n"
#
# erase calpont package
#
expect -re "# "
send_user "Erase Old Calpont Package "
send "ssh $USERNAME@$SERVER 'rpm -e --nodeps \$(rpm -qa | grep '^calpont') >/dev/null 2>&1; rpm -e --nodeps \$(rpm -qa | grep '^infinidb-')'\n"
expect -re "word: "
# password for ssh
send "$PASSWORD\n"
# check return
expect {
-re "uninstall completed" { } abort
-re "# " { } abort
-re "Failed dependencies" { send_user "FAILED: Failed dependencies\n" ; exit -1 }
-re "Permission denied, please try again" { send_user "FAILED: Invalid password\n" ; exit -1 }
}
sleep 10
send "ssh $USERNAME@$SERVER 'rm -f $INSTALLDIR/Calpont/releasenum >/dev/null 2>&1; test -x $INSTALLDIR/Calpont/bin/pre-uninstall && $INSTALLDIR/Calpont/bin/pre-uninstall'\n"
expect -re "word: "
# password for ssh
send "$PASSWORD\n"
# check return
expect {
-re "# " { send_user "DONE" } abort
-re "uninstall completed" { send_user "DONE" } abort
-re "Failed dependencies" { send_user "FAILED: Failed dependencies\n" ; exit -1 }
-re "Permission denied, please try again" { send_user "FAILED: Invalid password\n" ; exit -1 }
}
send_user "\n"
sleep 5
#
# install calpont package
#
set timeout 160
send_user "Install New Calpont Package "
send "ssh $USERNAME@$SERVER ' rpm -ivh --nodeps /root/$CALPONTPACKAGE'\n"
expect -re "word: "
# password for ssh
send "$PASSWORD\n"
# check return
expect {
-re "completed" { send_user "DONE" } abort
-re "Failed dependencies" { send_user "FAILED: Failed dependencies\n" ;
send_user "\n*** Installation Failed\n" ;
exit -1 }
-re "Permission denied, please try again" { send_user "FAILED: Invalid password\n" ; exit -1 }
}
send_user "\n"
set timeout 120
expect -re "# "
send "rm -f $PACKAGE\n"
#
if { $CONFIGFILE != "NULL"} {
#
# copy over Columnstore.xml file
#
send_user "Copy Calpont Configuration File "
send "scp $CONFIGFILE $USERNAME@$SERVER:/usr/local/mariadb/columnstore/etc/Columnstore.xml.rpmsave\n"
expect -re "word: "
# send the password
send "$PASSWORD\n"
expect {
-re "100%" { } abort
-re "scp" { send_user "FAILED: SCP failure\n" ; exit -1 }
-re "Permission denied, please try again" { send_user "FAILED: Invalid password\n" ; exit -1 }
-re "No such file or directory" { send_user "FAILED: Invalid package\n" ; exit -1 }
}
send "scp $CONFIGFILE $USERNAME@$SERVER:/usr/local/mariadb/columnstore/etc/Columnstore.xml\n"
expect -re "word: "
# send the password
send "$PASSWORD\n"
expect {
-re "100%" { send_user "DONE" } abort
-re "scp" { send_user "FAILED: SCP failure\n" ; exit -1 }
-re "Permission denied, please try again" { send_user "FAILED: Invalid password\n" ; exit -1 }
-re "No such file or directory" { send_user "FAILED: Invalid package\n" ; exit -1 }
}
send "scp $CONFIGFILE $USERNAME@$SERVER:/tmp/Columnstore.xml\n"
expect -re "word: "
# send the password
send "$PASSWORD\n"
expect {
-re "100%" { send_user " " } abort
}
} else {
#
# rename previous installed config file
#
send_user "Copy RPM-saved Calpont Configuration File "
send "ssh $USERNAME@$SERVER 'cd /usr/local/mariadb/columnstore/etc/;mv -f Columnstore.xml Columnstore.xml.install;cp -v Columnstore.xml.rpmsave Columnstore.xml'\n"
expect -re "word: "
# password for ssh
send "$PASSWORD\n"
# check return
expect {
-re "Columnstore.xml" { send_user "DONE" } abort
-re "Permission denied, please try again" { send_user "FAILED: Invalid password\n" ; exit -1 }
}
}
send_user "\n"
expect -re "# "
#
exit

View File

@ -1,177 +0,0 @@
/* Copyright (C) 2014 InfiniDB, Inc.
Copyright (C) 2016 MariaDB Corporaton
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; version 2 of
the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
MA 02110-1301, USA. */
/******************************************************************************************
* $Id: stackReleaseChecker.cpp 64 2006-10-12 22:21:51Z dhill $
*
*
* List of files being updated by configure:
* Calpont/etc/Columnstore.xml
*
*
******************************************************************************************/
/**
* @file
*/
#include <iterator>
#include <numeric>
#include <deque>
#include <iostream>
#include <ostream>
#include <fstream>
#include <cstdlib>
#include <string>
#include <limits.h>
#include <sstream>
#include <exception>
#include <stdexcept>
#include <vector>
#include "stdio.h"
#include "ctype.h"
#include <netdb.h>
#include <readline/readline.h>
#include <readline/history.h>
#include "liboamcpp.h"
#include "configcpp.h"
using namespace std;
using namespace oam;
using namespace config;
int main(int argc, char *argv[])
{
Oam oam;
string systemUser = "root";
string installParentModuleHostName;
string password;
string debug_flag = "1";
string systemName = "all";
bool VERBOSE = false;
Config* sysConfig = Config::makeConfig("./systems/CalpontSystems.xml");
for( int i = 1; i < argc; i++ )
{
if( string("-h") == argv[i] ) {
cout << endl;
cout << "'stackReleaseChecker' retrieves and prints the release installed on a stack." << endl;
cout << endl;
cout << "The list of systems are located in './systems/CalpontSystems.xml" << endl;
cout << endl;
cout << "Usage: stackReleaseChecker [-h][-s system][-v]" << endl;
cout << " -s system-name or leave blank for all systems" << endl;
cout << " -v verbose will give the version numbers" << endl;
exit (0);
}
else if( string("-s") == argv[i] ) {
i++;
if ( argc == i ) {
cout << "ERROR: missing system argument" << endl;
exit(-1);
}
systemName = argv[i];
}
else if( string("-v") == argv[i] )
VERBOSE = true;
}
int systemCount;
try {
systemCount = strtol(sysConfig->getConfig("NetworkConfig", "SystemCount").c_str(), 0, 0);
if ( systemCount == 0 ) {
cout << "ERROR: SystemCount in ./systems/CalpontSystems.xml equal to 0" << endl;
exit(-1);
}
}
catch(...)
{
cout << "ERROR: Problem getting SystemCount from ./systems/CalpontSystems.xml" << endl;
exit(-1);
}
bool FOUND = false;
for ( int i = 1 ; i < systemCount+1 ; i++)
{
string SystemName = "SystemName" + oam.itoa(i);
string oamParentModule = "OAMParentModule" + oam.itoa(i);
string SystemPassword = "SystemPassword" + oam.itoa(i);
string SystemUser = "SystemUser" + oam.itoa(i);
string tempSystem;
try {
tempSystem = sysConfig->getConfig("NetworkConfig", SystemName );
}
catch(...)
{
cout << "ERROR: Problem getting SystemName from ./systems/CalpontSystems.xml" << endl;
exit(-1);
}
if ( tempSystem == systemName || systemName == "all") {
try {
installParentModuleHostName = sysConfig->getConfig("NetworkConfig", oamParentModule );
password = sysConfig->getConfig("NetworkConfig", SystemPassword );
systemUser = sysConfig->getConfig("NetworkConfig", SystemUser );
FOUND = true;
}
catch(...)
{
cout << "ERROR: Problem getting SystemName from ./systems/CalpontSystems.xml" << endl;
exit(-1);
}
if ( tempSystem == "unassigned")
continue;
//get if root or no-root user install
string installDir = "/usr/local";
if ( systemUser != "root" )
installDir = "/home/" + systemUser;
installDir = installDir + "/Calpont";
string cmd;
if (!VERBOSE)
cmd = "./remote_command.sh " + installParentModuleHostName + " " + systemUser + " " + password + " 'cat " + installDir + "/releasenum' 'release=' cat: 10 " + debug_flag;
else
cmd = "./remote_command.sh " + installParentModuleHostName + " " + systemUser + " " + password + " '" + installDir + "/bin/mcsadmin getcalpontsoftware' 'tools' Error 10 " + debug_flag;
cout << "***** Calpont InfiniDB Package Release Information for stack '" << tempSystem << "' *****" << endl << endl;
system(cmd.c_str());
cout << endl;
cout << "***** Status of stack '" << tempSystem << "' *****" << endl << endl;
cmd = "./remote_command.sh " + installParentModuleHostName + " " + systemUser + " " + password + " '" + installDir + "/bin/mcsadmin getsystems' dummy Error 10 " + debug_flag;
system(cmd.c_str());
cout << endl << endl;
}
}
if ( !FOUND ) {
cout << "ERROR: System Name '" + systemName + "' not in ./systems/CalpontSystems.xml" << endl;
exit(-1);
}
}

View File

@ -272,7 +272,7 @@
<ClInclude Include="configcpp.h" />
<ClInclude Include="configstream.h" />
<ClInclude Include="resource.h" />
<ClInclude Include="versionnumber.h" />
<ClInclude Include="..\..\columnstoreversion.h" />
<ClInclude Include="writeonce.h" />
<ClInclude Include="xmlparser.h" />
</ItemGroup>
@ -300,4 +300,4 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
</Project>

View File

@ -41,7 +41,7 @@
<ClInclude Include="resource.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="versionnumber.h">
<ClInclude Include="..\..\columnstoreversion.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="writeonce.h">
@ -56,4 +56,4 @@
<Filter>Resource Files</Filter>
</ResourceCompile>
</ItemGroup>
</Project>
</Project>