You've already forked mariadb-columnstore-engine
mirror of
https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
synced 2026-01-06 08:21:10 +03:00
MCOL-1058 - added check for maradin password and mariadb-libs paclage
This commit is contained in:
@@ -711,6 +711,49 @@ checkTime()
|
||||
fi
|
||||
}
|
||||
|
||||
checkMysqlPassword()
|
||||
{
|
||||
# Locale check
|
||||
#
|
||||
echo ""
|
||||
echo "** Run MariaDB Console Password check"
|
||||
echo ""
|
||||
|
||||
#get MariaDB password
|
||||
pass=true
|
||||
`$COLUMNSTORE_INSTALL_DIR/mysql/mysql-Columnstore start > /dev/null 2>&1`
|
||||
`$COLUMNSTORE_INSTALL_DIR/bin/mariadb-command-line.sh > /dev/null 2>&1`
|
||||
if [ "$?" -eq 2 ]; then
|
||||
echo "${bold}Failed${normal}, Local Node MariaDB login failed with missing password file, /root/.my.cnf"
|
||||
fi
|
||||
|
||||
if [ "$IPADDRESSES" != "" ]; then
|
||||
`/bin/cp -f $COLUMNSTORE_INSTALL_DIR/bin/mariadb-command-line.sh /tmp/.`
|
||||
|
||||
for ipadd in "${NODE_IPADDRESS[@]}"; do
|
||||
`$COLUMNSTORE_INSTALL_DIR/bin/remote_command.sh $ipadd $PASSWORD $COLUMNSTORE_INSTALL_DIR/mysql/mysql-Columnstore start > /dev/null 2>&1`
|
||||
`$COLUMNSTORE_INSTALL_DIR/bin/remote_scp_put.sh $ipadd $PASSWORD /tmp/mariadb-command-line.sh 1 > /tmp/remote_scp_put_check 2>&1`
|
||||
if [ "$?" -ne 0 ]; then
|
||||
echo "Error running remote_scp_put.sh to $ipadd Node, check /tmp/remote_scp_put_check"
|
||||
exit 1
|
||||
else
|
||||
`$COLUMNSTORE_INSTALL_DIR/bin/remote_command.sh $ipadd $PASSWORD /tmp/mariadb-command-line.sh 1 > /tmp/remote_command_check`
|
||||
`cat /tmp/remote_command_check | grep "ERROR - PASSWORD" > /dev/null 2>&1`
|
||||
if [ "$?" -eq 0 ]; then
|
||||
echo "${bold}Failed${normal}, $ipadd Node MariaDB login failed with missing password file, /root/.my.cnf"
|
||||
pass=false
|
||||
fi
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
if ! $pass; then
|
||||
checkContinue
|
||||
else
|
||||
echo "Passed, no problems detected with a MariaDB password being set without an associated /root/.my.cnf"
|
||||
fi
|
||||
}
|
||||
|
||||
checkPackages()
|
||||
{
|
||||
#
|
||||
@@ -722,6 +765,7 @@ checkPackages()
|
||||
echo ""
|
||||
|
||||
declare -a CENTOS_PKG=("expect" "perl" "perl-DBI" "openssl" "zlib" "file" "sudo" "libaio" "rsync" "snappy" "net-tools" "perl-DBD-MySQL")
|
||||
declare -a CENTOS_PKG_NOT=("mariadb-libs")
|
||||
|
||||
if [ "$OS" == "centos6" ] || [ "$OS" == "centos7" ]; then
|
||||
if [ ! `which yum 2>/dev/null` ] ; then
|
||||
@@ -757,6 +801,24 @@ checkPackages()
|
||||
checkContinue
|
||||
fi
|
||||
|
||||
#check for package that shouldnt be installed
|
||||
pass=true
|
||||
for PKG in "${CENTOS_PKG_NOT[@]}"; do
|
||||
`yum list installed "$PKG" > /tmp/pkg_check 2>&1`
|
||||
`cat /tmp/pkg_check | grep Installed > /dev/null 2>&1`
|
||||
if [ "$?" -eq 0 ]; then
|
||||
echo "${bold}Failed${normal}, Local Node package ${bold}${PKG}${normal} is installed, please un-install"
|
||||
pass=false
|
||||
REPORTPASS=false
|
||||
fi
|
||||
done
|
||||
|
||||
if [ $pass == true ] ; then
|
||||
echo "Local Node - Passed, all packages that should not be installed aren't installed"
|
||||
else
|
||||
checkContinue
|
||||
fi
|
||||
|
||||
echo ""
|
||||
pass=true
|
||||
if [ "$IPADDRESSES" != "" ]; then
|
||||
@@ -792,11 +854,37 @@ checkPackages()
|
||||
pass=true
|
||||
fi
|
||||
echo ""
|
||||
|
||||
#check for package that shouldnt be installed
|
||||
for PKG in "${CENTOS_PKG_NOT[@]}"; do
|
||||
`$COLUMNSTORE_INSTALL_DIR/bin/remote_command.sh $ipadd $PASSWORD "yum list installed '$PKG' > /tmp/pkg_check 2>&1" 1 > /tmp/remote_command_check 2>&1`
|
||||
rc="$?"
|
||||
if [ $rc -eq 2 ] ; then
|
||||
echo "${bold}Failed${normal}, $ipadd Node, 'yum' not installed"
|
||||
pass=false
|
||||
REPORTPASS=false
|
||||
break
|
||||
elif [ $rc -ne 1 ] ; then
|
||||
echo "${bold}Failed${normal}, $ipadd Node package ${bold}${PKG}${normal} is installed, please un-install"
|
||||
pass=false
|
||||
REPORTPASS=false
|
||||
fi
|
||||
done
|
||||
|
||||
if $pass; then
|
||||
echo "$ipadd Node - Passed, all packages that should not be installed aren't installed"
|
||||
else
|
||||
checkContinue
|
||||
pass=true
|
||||
fi
|
||||
echo ""
|
||||
|
||||
done
|
||||
fi
|
||||
fi
|
||||
|
||||
declare -a SUSE_PKG=("boost-devel" "expect" "perl" "perl-DBI" "openssl" "file" "sudo" "libaio1" "rsync" "libsnappy1" "net-tools" "perl-DBD-mysql")
|
||||
declare -a SUSE_PKG_NOT=("mariadb" , "libmariadb18")
|
||||
|
||||
if [ "$OS" == "suse12" ]; then
|
||||
if [ ! `which rpm 2>/dev/null` ] ; then
|
||||
@@ -821,6 +909,24 @@ checkPackages()
|
||||
else
|
||||
checkContinue
|
||||
fi
|
||||
|
||||
#check for package that shouldnt be installed
|
||||
pass=true
|
||||
for PKG in "${SUSE_PKG_NOT[@]}"; do
|
||||
`rpm -qi "$PKG" > /tmp/pkg_check 2>&1`
|
||||
`cat /tmp/pkg_check | grep "not installed" > /dev/null 2>&1`
|
||||
if [ "$?" -ne 0 ]; then
|
||||
echo "${bold}Failed${normal}, Local Node package ${bold}${PKG}${normal} is installed, please un-install"
|
||||
pass=false
|
||||
REPORTPASS=false
|
||||
fi
|
||||
done
|
||||
|
||||
if $pass; then
|
||||
echo "Local Node - Passed, all packages that should not be installed aren't installed"
|
||||
else
|
||||
checkContinue
|
||||
fi
|
||||
fi
|
||||
|
||||
echo ""
|
||||
@@ -844,11 +950,32 @@ checkPackages()
|
||||
pass=true
|
||||
fi
|
||||
echo ""
|
||||
|
||||
#check for package that shouldnt be installed
|
||||
for PKG in "${SUSE_PKG_NOT[@]}"; do
|
||||
`$COLUMNSTORE_INSTALL_DIR/bin/remote_command.sh $ipadd $PASSWORD "rpm -qi '$PKG' > /tmp/pkg_check 2>&1" 1 > /tmp/remote_command_check 2>&1`
|
||||
rc="$?"
|
||||
if [ $rc -eq 0 ] ; then
|
||||
echo "${bold}Failed${normal}, $ipadd Node package ${bold}${PKG}${normal} is installed, please un-install"
|
||||
pass=false
|
||||
REPORTPASS=false
|
||||
fi
|
||||
done
|
||||
|
||||
if $pass; then
|
||||
echo "$ipadd Node - Passed, all packages that should not be installed aren't installed"
|
||||
else
|
||||
checkContinue
|
||||
pass=true
|
||||
fi
|
||||
echo ""
|
||||
|
||||
done
|
||||
fi
|
||||
fi
|
||||
|
||||
declare -a UBUNTU_PKG=("libboost-all-dev" "expect" "libdbi-perl" "perl" "openssl" "file" "sudo" "libreadline-dev" "rsync" "libsnappy1V5" "net-tools" "libdbd-mysql-perl")
|
||||
declare -a UBUNTU_PKG_NOT=("mariadb-server" "libmariadb18")
|
||||
|
||||
if [ "$OS" == "ubuntu16" ] ; then
|
||||
if [ ! `which dpkg 2>/dev/null` ] ; then
|
||||
@@ -873,6 +1000,24 @@ checkPackages()
|
||||
else
|
||||
checkContinue
|
||||
fi
|
||||
|
||||
#check for package that shouldnt be installed
|
||||
pass=true
|
||||
for PKG in "${UBUNTU_PKG_NOT[@]}"; do
|
||||
`dpkg -s "$PKG" > /tmp/pkg_check 2>&1`
|
||||
`cat /tmp/pkg_check | grep 'install ok installed' > /dev/null 2>&1`
|
||||
if [ "$?" -eq 0 ]; then
|
||||
echo "${bold}Failed${normal}, Local Node package ${bold}${PKG}${normal} is installed, please un-install"
|
||||
pass=false
|
||||
REPORTPASS=false
|
||||
fi
|
||||
done
|
||||
|
||||
if $pass; then
|
||||
echo "Local Node - Passed, all packages that should not be installed aren't installed"
|
||||
else
|
||||
checkContinue
|
||||
fi
|
||||
fi
|
||||
|
||||
echo ""
|
||||
@@ -909,11 +1054,45 @@ checkPackages()
|
||||
pass=true
|
||||
fi
|
||||
echo ""
|
||||
|
||||
#check for package that shouldnt be installed
|
||||
for PKG in "${UBUNTU_PKG_NOT[@]}"; do
|
||||
`$COLUMNSTORE_INSTALL_DIR/bin/remote_command.sh $ipadd $PASSWORD "dpkg -s '$PKG' > /tmp/pkg_check 2>&1" 1 > /tmp/remote_command_check 2>&1`
|
||||
`$COLUMNSTORE_INSTALL_DIR/bin/remote_scp_get.sh $ipadd $PASSWORD /tmp/pkg_check > /tmp/remote_scp_get_check 2>&1`
|
||||
if [ "$?" -ne 0 ]; then
|
||||
echo "Error running remote_scp_get.sh to $ipadd Node, check /tmp/remote_scp_get_check"
|
||||
else
|
||||
`cat /tmp/remote_command_check | grep 'command not found' > /dev/null 2>&1`
|
||||
if [ "$?" -eq 0 ]; then
|
||||
echo "${bold}Failed${normal}, $ipadd Node ${bold}dpkg${normal} package not installed"
|
||||
pass=false
|
||||
break
|
||||
else
|
||||
`cat pkg_check | grep 'install ok installed' > /dev/null 2>&1`
|
||||
if [ "$?" -eq 0 ]; then
|
||||
echo "${bold}Failed${normal}, $ipadd Node package ${bold}${PKG}${normal} is installed, please un-install"
|
||||
pass=false
|
||||
fi
|
||||
|
||||
`rm -f pkg_check`
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
if $pass; then
|
||||
echo "$ipadd Node - Passed, all packages that should not be installed aren't installed"
|
||||
else
|
||||
checkContinue
|
||||
pass=true
|
||||
fi
|
||||
echo ""
|
||||
|
||||
done
|
||||
fi
|
||||
fi
|
||||
|
||||
declare -a DEBIAN_PKG=("libboost-all-dev" "expect" "libdbi-perl" "perl" "openssl" "file" "sudo" "libreadline-dev" "rsync" "libsnappy1" "net-tools" "libdbd-mysql-perl")
|
||||
declare -a DEBIAN_PKG_NOT=("libmariadb18" "mariadb-server")
|
||||
|
||||
if [ "$OS" == "debian8" ]; then
|
||||
if [ ! `which dpkg 2>/dev/null` ] ; then
|
||||
@@ -938,6 +1117,24 @@ checkPackages()
|
||||
else
|
||||
checkContinue
|
||||
fi
|
||||
|
||||
#check for package that shouldnt be installed
|
||||
pass=true
|
||||
for PKG in "${DEBIAN_PKG_NOT[@]}"; do
|
||||
`dpkg -s "$PKG" > /tmp/pkg_check 2>&1`
|
||||
`cat /tmp/pkg_check | grep 'install ok installed' > /dev/null 2>&1`
|
||||
if [ "$?" -eq 0 ]; then
|
||||
echo "${bold}Failed${normal}, Local Node package ${bold}${PKG}${normal} is installed, please un-install"
|
||||
pass=false
|
||||
REPORTPASS=false
|
||||
fi
|
||||
done
|
||||
|
||||
if $pass; then
|
||||
echo "Local Node - Passed, all packages that should not be installed aren't installed"
|
||||
else
|
||||
checkContinue
|
||||
fi
|
||||
fi
|
||||
|
||||
echo ""
|
||||
@@ -974,11 +1171,45 @@ checkPackages()
|
||||
pass=true
|
||||
fi
|
||||
echo ""
|
||||
|
||||
#check for package that shouldnt be installed
|
||||
for PKG in "${DEBIAN_PKG_NOT[@]}"; do
|
||||
`$COLUMNSTORE_INSTALL_DIR/bin/remote_command.sh $ipadd $PASSWORD "dpkg -s '$PKG' > /tmp/pkg_check 2>&1" 1 > /tmp/remote_command_check 2>&1`
|
||||
`$COLUMNSTORE_INSTALL_DIR/bin/remote_scp_get.sh $ipadd $PASSWORD /tmp/pkg_check > /tmp/remote_scp_get_check 2>&1`
|
||||
if [ "$?" -ne 0 ]; then
|
||||
echo "Error running remote_scp_get.sh to $ipadd Node, check /tmp/remote_scp_get_check"
|
||||
else
|
||||
`cat /tmp/remote_command_check | grep 'command not found' > /dev/null 2>&1`
|
||||
if [ "$?" -eq 0 ]; then
|
||||
echo "${bold}Failed${normal}, $ipadd Node ${bold}dpkg${normal} package not installed"
|
||||
pass=false
|
||||
break
|
||||
else
|
||||
`cat pkg_check | grep 'install ok installed' > /dev/null 2>&1`
|
||||
if [ "$?" -eq 0 ]; then
|
||||
echo "${bold}Failed${normal}, $ipadd Node package ${bold}${PKG}${normal} is installed, please un-install"
|
||||
pass=false
|
||||
fi
|
||||
|
||||
`rm -f pkg_check`
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
if $pass; then
|
||||
echo "$ipadd Node - Passed, all packages that should not be installed aren't installed"
|
||||
else
|
||||
checkContinue
|
||||
pass=true
|
||||
fi
|
||||
echo ""
|
||||
|
||||
done
|
||||
fi
|
||||
fi
|
||||
|
||||
declare -a DEBIAN9_PKG=("libboost-all-dev" "expect" "libdbi-perl" "perl" "openssl" "file" "sudo" "libreadline5" "rsync" "libsnappy1V5" "net-tools" "libaio1")
|
||||
declare -a DEBIAN9_PKG_NOT=("libmariadb18" "mariadb-server")
|
||||
|
||||
if [ "$OS" == "debian9" ]; then
|
||||
if [ ! `which dpkg 2>/dev/null` ] ; then
|
||||
@@ -1003,6 +1234,25 @@ checkPackages()
|
||||
else
|
||||
checkContinue
|
||||
fi
|
||||
|
||||
#check for package that shouldnt be installed
|
||||
pass=true
|
||||
for PKG in "${DEBIAN9_PKG_NOT[@]}"; do
|
||||
`dpkg -s "$PKG" > /tmp/pkg_check 2>&1`
|
||||
`cat /tmp/pkg_check | grep 'install ok installed' > /dev/null 2>&1`
|
||||
if [ "$?" -eq 0 ]; then
|
||||
echo "${bold}Failed${normal}, Local Node package ${bold}${PKG}${normal} is installed, please un-install"
|
||||
pass=false
|
||||
REPORTPASS=false
|
||||
fi
|
||||
done
|
||||
|
||||
if $pass; then
|
||||
echo "Local Node - Passed, all packages that should not be installed aren't installed"
|
||||
else
|
||||
checkContinue
|
||||
fi
|
||||
|
||||
fi
|
||||
|
||||
echo ""
|
||||
@@ -1039,6 +1289,39 @@ checkPackages()
|
||||
pass=true
|
||||
fi
|
||||
echo ""
|
||||
|
||||
#check for package that shouldnt be installed
|
||||
for PKG in "${DEBIAN9_PKG_NOT[@]}"; do
|
||||
`$COLUMNSTORE_INSTALL_DIR/bin/remote_command.sh $ipadd $PASSWORD "dpkg -s '$PKG' > /tmp/pkg_check 2>&1" 1 > /tmp/remote_command_check 2>&1`
|
||||
`$COLUMNSTORE_INSTALL_DIR/bin/remote_scp_get.sh $ipadd $PASSWORD /tmp/pkg_check > /tmp/remote_scp_get_check 2>&1`
|
||||
if [ "$?" -ne 0 ]; then
|
||||
echo "Error running remote_scp_get.sh to $ipadd Node, check /tmp/remote_scp_get_check"
|
||||
else
|
||||
`cat /tmp/remote_command_check | grep 'command not found' > /dev/null 2>&1`
|
||||
if [ "$?" -eq 0 ]; then
|
||||
echo "${bold}Failed${normal}, $ipadd Node ${bold}dpkg${normal} package not installed"
|
||||
pass=false
|
||||
break
|
||||
else
|
||||
`cat pkg_check | grep 'install ok installed' > /dev/null 2>&1`
|
||||
if [ "$?" -eq 0 ]; then
|
||||
echo "${bold}Failed${normal}, $ipadd Node package ${bold}${PKG}${normal} is installed, please un-install"
|
||||
pass=false
|
||||
fi
|
||||
|
||||
`rm -f pkg_check`
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
if $pass; then
|
||||
echo "$ipadd Node - Passed, all packages that should not be installed aren't installed"
|
||||
else
|
||||
checkContinue
|
||||
pass=true
|
||||
fi
|
||||
echo ""
|
||||
|
||||
done
|
||||
fi
|
||||
fi
|
||||
@@ -1063,6 +1346,8 @@ if [ "$IPADDRESSES" != "" ]; then
|
||||
checkPorts
|
||||
checkTime
|
||||
fi
|
||||
|
||||
checkMysqlPassword
|
||||
checkPackages
|
||||
|
||||
if [ $REPORTPASS == true ] ; then
|
||||
|
||||
Reference in New Issue
Block a user