You've already forked mariadb-columnstore-engine
mirror of
https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
synced 2025-12-03 08:20:57 +03:00
170 lines
4.8 KiB
Bash
Executable File
170 lines
4.8 KiB
Bash
Executable File
#!/bin/bash
|
|
#
|
|
# $Id: post-uninstall 421 2007-04-05 15:46:55Z dhill $
|
|
#
|
|
# Post-uninstall steps for columnstore install
|
|
|
|
prefix=/usr/local
|
|
installdir=$prefix/mariadb/columnstore
|
|
rpmmode=install
|
|
user=$USER
|
|
sudo=sudo
|
|
if [ -z "$user" ]; then
|
|
user=root
|
|
sudo=" "
|
|
fi
|
|
quiet=0
|
|
|
|
for arg in "$@"; do
|
|
if [ `expr -- "$arg" : '--prefix='` -eq 9 ]; then
|
|
prefix="`echo $arg | awk -F= '{print $2}'`"
|
|
installdir=$prefix/mariadb/columnstore
|
|
elif [ `expr -- "$arg" : '--rpmmode='` -eq 10 ]; then
|
|
rpmmode="`echo $arg | awk -F= '{print $2}'`"
|
|
elif [ `expr -- "$arg" : '--installdir='` -eq 13 ]; then
|
|
installdir="`echo $arg | awk -F= '{print $2}'`"
|
|
prefix=`dirname $installdir`
|
|
elif [ `expr -- "$arg" : '--user='` -eq 7 ]; then
|
|
user="`echo $arg | awk -F= '{print $2}'`"
|
|
elif [ `expr -- "$arg" : '--quiet'` -eq 7 ]; then
|
|
quiet=1
|
|
else
|
|
echo "post-uninstall: ignoring unknown argument: $arg" 1>&2
|
|
fi
|
|
done
|
|
|
|
#stop services
|
|
$installdir/bin/columnstore stop > /dev/null 2>&1
|
|
$installdir/myql/columnstore-Mysql stop > /dev/null 2>&1
|
|
|
|
if [ $installdir == "/usr/local/mariadb/columnstore" ]; then
|
|
# remove library config file
|
|
rm -f /etc/ld.so.conf.d/columnstore.conf
|
|
rm -f /etc/ld.so.cache
|
|
ldconfig
|
|
fi
|
|
|
|
# uninstall OS scripts updated by postConfigure
|
|
if test -f /root/.bashrc.columnstoreSave ; then
|
|
$sudo mv -f /root/.bashrc.columnstoreSave /root/.bashrc > /dev/null 2>&1
|
|
fi
|
|
if test -f /etc/exports.columnstoreSave ; then
|
|
$sudo mv -f /etc/exports.columnstoreSave /etc/exports > /dev/null 2>&1
|
|
else
|
|
$sudo rm -f /etc/exports > /dev/null 2>&1
|
|
fi
|
|
if test -f /etc/rc.d/rc.local.columnstoreSave ; then
|
|
$sudo mv -f /etc/rc.d/rc.local.columnstoreSave /etc/rc.d/rc.local > /dev/null 2>&1
|
|
fi
|
|
if test -f /etc/rc.local.columnstoreSave ; then
|
|
$sudo mv -f /etc/rc.local.columnstoreSave /etc/rc.local > /dev/null 2>&1
|
|
fi
|
|
|
|
export INFINIDB_INSTALL_DIR=$installdir
|
|
|
|
cloud=`$INFINIDB_INSTALL_DIR/bin/getConfig Installation Cloud`
|
|
if [ $cloud = "amazon-ec2" ] || [ $cloud = "amazon-vpc" ]; then
|
|
if test -f /etc/fstab ; then
|
|
$sudo sed -i '/Columnstore\/data/d' /etc/fstab > /dev/null 2>&1
|
|
fi
|
|
fi
|
|
|
|
#remove log file directories
|
|
#rm -rf /var/log/mariadb/columnstore > /dev/null 2>&1
|
|
#rm -f $installdir/mysql/db/*.err > /dev/null 2>&1
|
|
rm -f /var/log/mariadb/columnstore/activeAlarms > /dev/null 2>&1
|
|
rm -f /var/log/mariadb/columnstore/*.log1 > /dev/null 2>&1
|
|
rm -rf $installdir/mysql/db/columnstore_log_archive > /dev/null 2>&1
|
|
sudo rm -f /etc/default/columnstore
|
|
|
|
# remove Mariab Columnstore Log Rotate File abd Transaction Log File
|
|
rm -f /etc/logrotate.d/columnstore > /dev/null 2>&1
|
|
rm -f /etc/cron.d/transactionLog > /dev/null 2>&1
|
|
|
|
# delete Mariab Columnstore shared memory segments
|
|
$installdir/bin/clearShm > /dev/null 2>&1
|
|
|
|
# delete prat files
|
|
rm -f /etc/cron.d/ps > /dev/null 2>&1
|
|
rm -f /etc/pscollect > /dev/null 2>&1
|
|
/etc/init.d/crond reload > /dev/null 2>&1
|
|
systemctl reload crond.service > /dev/null 2>&1
|
|
|
|
# delete tmp files
|
|
rm -f $installdir/local/*.columnstore
|
|
rm -rf $installdir/local/etc/
|
|
rm -rf /tmp/bucketreuse
|
|
rm -f /tmp/columnstore.txt
|
|
rm -f /tmp/dbbuilder.*
|
|
rm -f /tmp/dbrmfiles
|
|
rm -f /var/lock/subsys/columnstore
|
|
rm -f /tmp/pkgcheck
|
|
rm -f /tmp/upgrade-status.log.*
|
|
rm -f /tmp/mount.log
|
|
rm -f $installdir/data/bulk/tmpjob/* >/dev/null 2>&1
|
|
rm -rf /tmp/columnstore_tmp_files
|
|
rm -f $installdir/local/moveDbrootTransactionLog
|
|
|
|
#delete any old setenv files under home directory
|
|
if [ $user = "root" ]; then
|
|
rm -f /root/setenv-hdfs*
|
|
else
|
|
rm -f /home/$user/setenv-hdfs*
|
|
fi
|
|
|
|
# delete core files
|
|
#rm -f /var/log/mariadb/columnstore/corefiles/* > /dev/null 2>&1
|
|
|
|
#uninstall MariaDB Columnstore system logging
|
|
if [ -x $installdir/bin/syslogSetup.sh ]; then
|
|
if [ $user = "root" ]; then
|
|
$installdir/bin/syslogSetup.sh uninstall >/dev/null 2>&1
|
|
else
|
|
sudo $installdir/bin/syslogSetup.sh uninstall >/dev/null 2>&1
|
|
fi
|
|
fi
|
|
|
|
#remove the start service command
|
|
systemctl=`which systemctl 2>/dev/null`
|
|
if [ -n "$systemctl" ]; then
|
|
|
|
systemctl disable columnstore >/dev/null 2>&1
|
|
rm -f /usr/lib/systemd/system/columnstore.service
|
|
else
|
|
chkconfig=`which chkconfig 2>/dev/null`
|
|
if [ -n "$chkconfig" ]; then
|
|
|
|
chkconfig columnstore off > /dev/null 2>&1
|
|
chkconfig --del columnstore > /dev/null 2>&1
|
|
rm -f /etc/init.d/columnstore > /dev/null 2>&1
|
|
else
|
|
updaterc=`which update-rc.d 2>/dev/null`
|
|
if [ -n "$updaterc" ]; then
|
|
|
|
update-rc.d -f columnstore remove > /dev/null 2>&1
|
|
rm -f /etc/init.d/columnstore > /dev/null 2>&1
|
|
fi
|
|
fi
|
|
fi
|
|
|
|
|
|
if [ $quiet != 1 ]; then
|
|
#make copy of Columnstore.xml
|
|
/bin/cp -f $installdir/etc/Columnstore.xml $installdir/etc/Columnstore.xml.rpmsave > /dev/null 2>&1
|
|
/bin/cp -f $installdir/mysql/my.cnf $installdir/mysql/my.cnf.rpmsave > /dev/null 2>&1
|
|
fi
|
|
|
|
#umount file systems
|
|
if [ $user = "root" ]; then
|
|
rm -f $installdir/data*/OAMdbrootCheck > /dev/null 2>&1
|
|
else
|
|
sudo rm -f $installdir/data*/OAMdbrootCheck > /dev/null 2>&1
|
|
fi
|
|
|
|
#tell user to run post configure script
|
|
echo " "
|
|
echo "Mariab Columnstore uninstall completed"
|
|
|
|
exit 0
|
|
|