1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-08-01 06:46:55 +03:00

Merge pull request #1023 from LinuxJedi/mariadb-systemctl

MCOL-3718 Use systemd instead of mysql-Columnstore
This commit is contained in:
benthompson15
2020-02-12 10:01:26 -06:00
committed by GitHub
10 changed files with 161 additions and 544 deletions

View File

@ -108,7 +108,6 @@ fi
if [ $user = "root" ]; then
#setup the columnstore service script
rm -f /etc/init.d/columnstore >/dev/null 2>&1
rm -f /etc/init.d/mysql-Columnstore >/dev/null 2>&1
rm -f /etc/default/columnstore
systemctl=`which systemctl 2>/dev/null`
@ -170,7 +169,6 @@ mcsSetConfig -d Installation LockFileDirectory $lockdir
mkdir $lockdir >/dev/null 2>&1
rm -f $lockdir/mysql-Columnstore
rm -f $lockdir/columnstore
#backup copy of Alarm Config File

View File

@ -25,7 +25,14 @@ done
#stop services
columnstore stop > /dev/null 2>&1
mysql-Columnstore stop > /dev/null 2>&1
# Test we are using systemd
systemctl cat mariadb.service > /dev/null 2>&1
if [ $? -eq 0 ]; then
systemctl stop mariadb.service > /dev/null 2>&1
else
pkill mysqld
fi
cloud=`mcsGetConfig Installation Cloud`
if [ $cloud = "amazon-ec2" ] || [ $cloud = "amazon-vpc" ]; then
@ -55,7 +62,6 @@ rm -f /var/lib/columnstore/local/moveDbrootTransactionLog
lockdir=`mcsGetConfig Installation LockFileDirectory`
rm -f $lockdir/columnstore
rm -f $lockdir/mysql-Columnstore
# delete core files
#rm -f /var/log/mariadb/columnstore/corefiles/* > /dev/null 2>&1

View File

@ -93,7 +93,13 @@ stop() {
RETVAL=$?
rm -f $lockdir/columnstore
fuser -k 8604/tcp > /dev/null 2>&1
mysql-Columnstore stop > /dev/null 2>&1
# Test we are using systemd
systemctl cat mariadb.service > /dev/null 2>&1
if [ $? -eq 0 ]; then
systemctl stop mariadb.service > /dev/null 2>&1
else
pkill mysqld
fi
pkill ProcMon
pkill ProcMgr
return $RETVAL

View File

@ -11,7 +11,13 @@ checkForError() {
if [ `cat ${tmpdir}/error.check | wc -c` -ne 0 ]; then
echo "MySQL Password file missing or incorrect, check .my.cnf file"
rm -f ${tmpdir}/error.check
mysql-Columnstore stop
# Test we are using systemd
systemctl cat mariadb.service > /dev/null 2>&1
if [ $? -eq 0 ]; then
systemctl stop mariadb.service > /dev/null 2>&1
else
pkill mysqld
fi
sleep 2
exit 2;
fi
@ -54,9 +60,23 @@ for arg in "$@"; do
done
# Restart in the same way that mysqld will be started normally.
mysql-Columnstore stop >/dev/null 2>&1
# Test we are using systemd
systemctl cat mariadb.service > /dev/null 2>&1
if [ $? -eq 0 ]; then
systemctl stop mariadb.service > /dev/null 2>&1
else
pkill mysqld
fi
sleep 2
mysql-Columnstore start --skip-grant-tables
export MYSQL_OPTS="--skip-grant-tables"
# Test we are using systemd
systemctl cat mariadb.service > /dev/null 2>&1
if [ $? -eq 0 ]; then
systemctl start mariadb.service
else
/usr/bin/mysqld_safe --skip-grant-tables &
fi
unset MYSQL_OPTS
sleep 5
@ -65,12 +85,24 @@ install_mcs_mysql.sh --tmpdir=$tmpdir
checkForError
if [ $? -ne 0 ]; then
echo "ERROR: Invalid password in .my.cnf, or Columnstore plugin install missing"
mysql-Columnstore stop
# Test we are using systemd
systemctl cat mariadb.service > /dev/null 2>&1
if [ $? -eq 0 ]; then
systemctl stop mariadb.service > /dev/null 2>&1
else
pkill mysqld
fi
sleep 2
exit 2;
fi
mysql-Columnstore stop
# Test we are using systemd
systemctl cat mariadb.service > /dev/null 2>&1
if [ $? -eq 0 ]; then
systemctl stop mariadb.service > /dev/null 2>&1
else
pkill mysqld
fi
exit 0