1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-12-24 14:20:59 +03:00

Merge pull request #193 from mariadb-corporation/MCOL-702

MCOL-702 / MCOL-368 - changed from builder to whoami
This commit is contained in:
david hill
2017-06-13 09:59:10 -05:00
committed by GitHub
24 changed files with 73 additions and 45 deletions

View File

@@ -32,7 +32,11 @@ if { $IDIR != "" } {
set env(COLUMNSTORE_INSTALL_DIR) $INSTALLDIR
set PREFIX [file dirname $INSTALLDIR]
set PREFIX [file dirname $PREFIX]
set USERNAME $env(USER)
exec whoami >/tmp/whoami.tmp
set USERNAME [exec cat /tmp/whoami.tmp]
exec rm -f /tmp/whoami.tmp
set UNM [lindex $argv 10]
if { $UNM != "" } {
set USERNAME $UNM

View File

@@ -1,4 +1,6 @@
# MariaDB Columnstore Database Platform Logging
$FileGroup groupname
$FileOwner username
local1.crit -/var/log/mariadb/columnstore/crit.log
local1.err -/var/log/mariadb/columnstore/err.log
local1.warning -/var/log/mariadb/columnstore/warning.log

View File

@@ -14,6 +14,8 @@ else
INSTALLDIR="/usr/local/mariadb/columnstore"
fi
USER=`whoami 2>/dev/null`
if [ $USER = "root" ]; then
SUDO=" "
else

View File

@@ -12,10 +12,7 @@
prefix=/usr/local
installdir=$prefix/mariadb/columnstore
rpmmode=install
user=$USER
if [ -z "$user" ]; then
user=root
fi
user=`whoami 2>/dev/null`
quiet=0
shiftcnt=0

View File

@@ -24,7 +24,10 @@ set IDIR [lindex $argv 8]
if { $IDIR != "" } {
set INSTALLDIR $IDIR
}
set USERNAME "root"
exec whoami >/tmp/whoami.tmp
set USERNAME [exec cat /tmp/whoami.tmp]
exec rm -f /tmp/whoami.tmp
set UNM [lindex $argv 13]
if { $UNM != "" } {
set USERNAME $UNM

View File

@@ -4,13 +4,12 @@
#
# Post-install steps for columnstore install
prefix=/usr/local
prefix=/home/quest
installdir=$prefix/mariadb/columnstore
rpmmode=install
user=root
user=`whoami 2>/dev/null`
SUDO=" "
if [ $USER != "root" ]; then
user=$USER
if [ $user != "root" ]; then
SUDO="sudo "
fi
@@ -126,7 +125,7 @@ test -d /var/log/mariadb || $SUDO mkdir /var/log/mariadb >/dev/null 2>&1
test -d /var/log/mariadb/columnstore || $SUDO mkdir /var/log/mariadb/columnstore >/dev/null 2>&1
if [ $user != "root" ]; then
$SUDO chmod -R 777 /var/log/mariadb >/dev/null 2>&1
$SUDO chmod -R 755 /var/log/mariadb >/dev/null 2>&1
$SUDO chown -R $user:$user /var/log/mariadb >/dev/null 2>&1
fi
@@ -165,10 +164,6 @@ chmod 755 /var/log/mariadb/columnstore/corefiles > /dev/null 2>&1
mkdir /mnt/tmp > /dev/null 2>&1
mkdir /var/log/mariadb/columnstore/data/archive > /dev/null 2>&1
# install Columnstore Log Rotate File
$SUDO cp $installdir/bin/columnstoreLogRotate /etc/logrotate.d/columnstore > /dev/null 2>&1
$SUDO chmod 644 /etc/logrotate.d/columnstore
# remove mysql archive log
test -d $installdir/mysql/db || mkdir -p $installdir/mysql/db
rm -rf $installdir/mysql/db/columnstore_log_archive > /dev/null 2>&1
@@ -209,10 +204,20 @@ if [ $user = "root" ]; then
fi
fi
#setup MariaDB Columnstore system logging
sed -i -e s/groupname/$user/g $installdir/bin/columnstoreSyslog7
sed -i -e s/username/$user/g $installdir/bin/columnstoreSyslog7
if [ $user = "root" ]; then
$installdir/bin/syslogSetup.sh install > /tmp/syslog_install.log 2>&1
rm -f /etc/default/columnstore
else
sed -i -e s@/usr/local/mariadb/columnstore@$installdir@g $installdir/bin/columnstore.def
sed -i -e s@/usr/local/mariadb/columnstore@$installdir@g $installdir/bin/columnstoreLogRotate
$SUDO cp $installdir/bin/columnstore.def /etc/default/columnstore
sed -i -e s@prefix=/home/quest@prefix=$prefix@g $installdir/bin/*
$SUDO rm -f /tmp/* > /dev/null 2>&1
$installdir/bin/syslogSetup.sh --installdir=$installdir install > /tmp/syslog_install.log 2>&1
$SUDO chown $user:$user $installdir/etc/Columnstore.xml
@@ -220,14 +225,14 @@ else
$SUDO mkdir /var/lock/subsys > /dev/null 2>&1
$SUDO chmod 777 /var/lock/subsys > /dev/null 2>&1
$SUDO rm -f /var/lock/subsys/mysql-Columnstore
$SUDO chmod 666 /etc/fstab
$SUDO chmod 644 /etc/fstab
sed -i -e s@/usr/local/mariadb/columnstore@$installdir@g $installdir/bin/columnstore.def
$SUDO cp $installdir/bin/columnstore.def /etc/default/columnstore
sed -i -e s@prefix=/usr/local@prefix=$prefix@g $installdir/bin/*
fi
# install Columnstore Log Rotate File
$SUDO cp $installdir/bin/columnstoreLogRotate /etc/logrotate.d/columnstore > /dev/null 2>&1
$SUDO chmod 644 /etc/logrotate.d/columnstore
#check if MariaDB Columnstore system logging was setup
cat /tmp/syslog_install.log | grep 'No System Logging' >/dev/null 2>&1
if [ $? -eq 0 ]; then

View File

@@ -79,6 +79,7 @@ for arg in "$@"; do
fi
done
USER=`whoami 2>/dev/null`
if [ $USER != "root" ]; then
sudo ldconfig >/dev/null 2>&1
export COLUMNSTORE_INSTALL_DIR=$installdir

View File

@@ -9,6 +9,7 @@ installdir=$prefix/mariadb/columnstore
rpmmode=install
user=mysql
if [ $EUID -ne 0 ]; then
USER=`whoami 2>/dev/null`
user=$USER
fi

View File

@@ -7,10 +7,9 @@
prefix=/usr/local
installdir=$prefix/mariadb/columnstore
rpmmode=install
user=`whoami 2>/dev/null`
SUDO=" "
user=root
if [ $USER != "root" ]; then
user=$USER
if [ $user != "root" ]; then
SUDO="sudo "
fi

View File

@@ -16,11 +16,9 @@ set PASSWORD [lindex $argv 1]
set COMMAND [lindex $argv 2]
set DEBUG [lindex $argv 3]
if {[info exists env(USER)]} {
set USERNAME $env(USER)
} else {
set USERNAME "root"
}
exec whoami >/tmp/whoami.tmp
set USERNAME [exec cat /tmp/whoami.tmp]
exec rm -f /tmp/whoami.tmp
set UNM [lindex $argv 4]
if { $UNM != "" && $UNM != "-" } {

View File

@@ -7,7 +7,9 @@
# Argument 2 - Remote Server root password
# Argument 3 - Command
set timeout 10
set USERNAME $env(USER)"@"
exec whoami >/tmp/whoami.tmp
set USERNAME [exec cat /tmp/whoami.tmp]
exec rm -f /tmp/whoami.tmp
set SERVER [lindex $argv 0]
set PASSWORD [lindex $argv 1]
set FILE [lindex $argv 2]

View File

@@ -7,7 +7,9 @@
# Argument 2 - Remote Server root password
# Argument 3 - Command
set timeout 30
set USERNAME $env(USER)"@"
exec whoami >/tmp/whoami.tmp
set USERNAME [exec cat /tmp/whoami.tmp]
exec rm -f /tmp/whoami.tmp
set SERVER [lindex $argv 0]
set PASSWORD [lindex $argv 1]
set FILE [lindex $argv 2]

View File

@@ -14,12 +14,9 @@ set DEBUG [lindex $argv 3]
log_user $DEBUG
spawn -noecho /bin/bash
if {[info exists env(USER)]} {
set USERNAME $env(USER)
} else {
set USERNAME "root"
}
exec whoami >/tmp/whoami.tmp
set USERNAME [exec cat /tmp/whoami.tmp]
exec rm -f /tmp/whoami.tmp
if { $PASSWORD == "ssh" } {
set PASSWORD ""

View File

@@ -14,6 +14,8 @@ else
INSTALLDIR="/usr/local/mariadb/columnstore"
fi
USER=`whoami 2>/dev/null`
if [ $USER = "root" ]; then
SUDO=" "
else

View File

@@ -12,10 +12,10 @@ installdir=$prefix/mariadb/columnstore
syslog_conf=nofile
rsyslog7=0
user=root
user=`whoami 2>/dev/null`
SUDO=" "
if [ "$USER" != "root" ]; then
user=$USER
if [ "$user" != "root" ]; then
SUDO="sudo "
fi

View File

@@ -26,7 +26,11 @@ set IDIR [lindex $argv 10]
if { $IDIR != "" } {
set INSTALLDIR $IDIR
}
set USERNAME "root"
exec whoami >/tmp/whoami.tmp
set USERNAME [exec cat /tmp/whoami.tmp]
exec rm -f /tmp/whoami.tmp
set UNM [lindex $argv 11]
if { $UNM != "" } {
set USERNAME $UNM

View File

@@ -14,6 +14,7 @@ else
INSTALLDIR="/usr/local/mariadb/columnstore"
fi
USER=`whoami 2>/dev/null`
if [ $USER = "root" ]; then
SUDO=" "
else
@@ -35,4 +36,4 @@ fi
} > /tmp/${MODULE}_bulklogReport.txt
exit 0
exit 0

View File

@@ -14,6 +14,7 @@ else
INSTALLDIR="/usr/local/mariadb/columnstore"
fi
USER=`whoami 2>/dev/null`
if [ $USER = "root" ]; then
SUDO=" "
else
@@ -87,4 +88,4 @@ $SUDO top -b -n 1
} > /tmp/${MODULE}_configReport.txt
exit 0
exit 0

View File

@@ -13,6 +13,7 @@ else
INSTALLDIR="/usr/local/mariadb/columnstore"
fi
USER=`whoami 2>/dev/null`
if [ $USER = "hdfs" ]; then
SUDO=" "
else

View File

@@ -14,6 +14,7 @@ else
INSTALLDIR="/usr/local/mariadb/columnstore"
fi
USER=`whoami 2>/dev/null`
if [ $USER = "root" ]; then
SUDO=" "
else
@@ -98,4 +99,4 @@ ifconfig -a 2>/dev/null
} > /tmp/${MODULE}_hardwareReport.txt
exit 0
exit 0

View File

@@ -14,6 +14,7 @@ else
INSTALLDIR="/usr/local/mariadb/columnstore"
fi
USER=`whoami 2>/dev/null`
if [ $USER = "root" ]; then
SUDO=" "
else

View File

@@ -14,6 +14,7 @@ else
INSTALLDIR="/usr/local/mariadb/columnstore"
fi
USER=`whoami 2>/dev/null`
if [ $USER = "root" ]; then
SUDO=" "
else
@@ -71,4 +72,4 @@ $INSTALLDIR/bin/editem -i 2>/dev/null
} > /tmp/${MODULE}_resourceReport.txt
exit 0
exit 0

View File

@@ -14,6 +14,7 @@ else
INSTALLDIR="/usr/local/mariadb/columnstore"
fi
USER=`whoami 2>/dev/null`
if [ $USER = "root" ]; then
SUDO=" "
else
@@ -50,4 +51,4 @@ $INSTALLDIR/bin/mcsadmin getStorageConfig
} > /tmp/${MODULE}_softwareReport.txt
exit 0
exit 0

View File

@@ -192,6 +192,8 @@ if [ "$IPADDRESSES" != "" ]; then
fi
fi
USER=`whoami 2>/dev/null`
checkLocalOS()
{
echo "** Validate local OS is supported"