1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-07-30 19:23:07 +03:00

Make mysqld work without systemd

ColumnStore should now start/stop mysqld where the systemd service is
not available.
This commit is contained in:
Andrew Hutchings
2020-02-04 14:16:49 +00:00
parent 6cf6519019
commit 7df731a3a6
5 changed files with 109 additions and 17 deletions

View File

@ -25,7 +25,14 @@ done
#stop services
columnstore stop > /dev/null 2>&1
systemctl stop mariadb.service > /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

View File

@ -90,7 +90,13 @@ stop() {
RETVAL=$?
rm -f $lockdir/columnstore
fuser -k 8604/tcp > /dev/null 2>&1
systemctl stop mariadb.service > /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
systemctl stop mysqld.service
# 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,10 +60,22 @@ for arg in "$@"; do
done
# Restart in the same way that mysqld will be started normally.
systemctl stop mariadb.service >/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
export MYSQL_OPTS="--skip-grant-tables"
systemctl start mariadb.service
# 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
@ -67,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"
systemctl stop mariadb.service
# 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
systemctl stop mariadb.service
# 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