You've already forked mariadb-columnstore-engine
mirror of
https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
synced 2025-08-07 03:22:57 +03:00
MCOL-3830 post-mysql-install fix on systems not running systemd
This commit is contained in:
@@ -4,6 +4,15 @@
|
|||||||
#
|
#
|
||||||
# pre-uninstall steps for columnstore install
|
# pre-uninstall steps for columnstore install
|
||||||
|
|
||||||
|
running_systemd() {
|
||||||
|
if [ ps --no-headers -o comm 1 == "systemd" ]; then
|
||||||
|
echo 0
|
||||||
|
else
|
||||||
|
echo 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
rpmmode=install
|
rpmmode=install
|
||||||
user=`whoami 2>/dev/null`
|
user=`whoami 2>/dev/null`
|
||||||
|
|
||||||
@@ -28,7 +37,7 @@ columnstore stop > /dev/null 2>&1
|
|||||||
|
|
||||||
# Test we are using systemd
|
# Test we are using systemd
|
||||||
systemctl cat mariadb.service > /dev/null 2>&1
|
systemctl cat mariadb.service > /dev/null 2>&1
|
||||||
if [ $? -eq 0 ]; then
|
if [ $? -eq 0 ] && [ $(running_systemd) -eq 0 ]; then
|
||||||
systemctl stop mariadb.service > /dev/null 2>&1
|
systemctl stop mariadb.service > /dev/null 2>&1
|
||||||
else
|
else
|
||||||
pkill mysqld
|
pkill mysqld
|
||||||
|
@@ -17,6 +17,14 @@
|
|||||||
# Short-Description: Start/stop MariaDB Columnstore DW DBMS
|
# Short-Description: Start/stop MariaDB Columnstore DW DBMS
|
||||||
### END INIT INFO
|
### END INIT INFO
|
||||||
|
|
||||||
|
running_systemd() {
|
||||||
|
if [ ps --no-headers -o comm 1 == "systemd" ]; then
|
||||||
|
echo 0
|
||||||
|
else
|
||||||
|
echo 1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
USER=`whoami 2>/dev/null`
|
USER=`whoami 2>/dev/null`
|
||||||
|
|
||||||
# Source function library.
|
# Source function library.
|
||||||
@@ -95,7 +103,7 @@ stop() {
|
|||||||
fuser -k 8604/tcp > /dev/null 2>&1
|
fuser -k 8604/tcp > /dev/null 2>&1
|
||||||
# Test we are using systemd
|
# Test we are using systemd
|
||||||
systemctl cat mariadb.service > /dev/null 2>&1
|
systemctl cat mariadb.service > /dev/null 2>&1
|
||||||
if [ $? -eq 0 ]; then
|
if [ $? -eq 0 ] && [ $(running_systemd) -eq 0 ]; then
|
||||||
systemctl stop mariadb.service > /dev/null 2>&1
|
systemctl stop mariadb.service > /dev/null 2>&1
|
||||||
else
|
else
|
||||||
pkill mysqld
|
pkill mysqld
|
||||||
|
@@ -4,6 +4,15 @@
|
|||||||
#
|
#
|
||||||
# Post-install steps for calpont-mysql install
|
# Post-install steps for calpont-mysql install
|
||||||
|
|
||||||
|
# check if running systemd
|
||||||
|
running_systemd() {
|
||||||
|
if [ ps --no-headers -o comm 1 == "systemd" ]; then
|
||||||
|
echo 0
|
||||||
|
else
|
||||||
|
echo 1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
# check log for error
|
# check log for error
|
||||||
checkForError() {
|
checkForError() {
|
||||||
# check for password error
|
# check for password error
|
||||||
@@ -13,7 +22,7 @@ checkForError() {
|
|||||||
rm -f ${tmpdir}/error.check
|
rm -f ${tmpdir}/error.check
|
||||||
# Test we are using systemd
|
# Test we are using systemd
|
||||||
systemctl cat mariadb.service > /dev/null 2>&1
|
systemctl cat mariadb.service > /dev/null 2>&1
|
||||||
if [ $? -eq 0 ]; then
|
if [ $? -eq 0 ] && [ $(running_systemd) -eq 0 ]; then
|
||||||
systemctl stop mariadb.service > /dev/null 2>&1
|
systemctl stop mariadb.service > /dev/null 2>&1
|
||||||
else
|
else
|
||||||
pkill mysqld
|
pkill mysqld
|
||||||
@@ -62,7 +71,7 @@ done
|
|||||||
# Restart in the same way that mysqld will be started normally.
|
# Restart in the same way that mysqld will be started normally.
|
||||||
# Test we are using systemd
|
# Test we are using systemd
|
||||||
systemctl cat mariadb.service > /dev/null 2>&1
|
systemctl cat mariadb.service > /dev/null 2>&1
|
||||||
if [ $? -eq 0 ]; then
|
if [ $? -eq 0 ] && [ $(running_systemd) -eq 0 ]; then
|
||||||
systemctl stop mariadb.service > /dev/null 2>&1
|
systemctl stop mariadb.service > /dev/null 2>&1
|
||||||
else
|
else
|
||||||
pkill mysqld
|
pkill mysqld
|
||||||
@@ -71,7 +80,7 @@ sleep 2
|
|||||||
export MYSQL_OPTS="--skip-grant-tables"
|
export MYSQL_OPTS="--skip-grant-tables"
|
||||||
# Test we are using systemd
|
# Test we are using systemd
|
||||||
systemctl cat mariadb.service > /dev/null 2>&1
|
systemctl cat mariadb.service > /dev/null 2>&1
|
||||||
if [ $? -eq 0 ]; then
|
if [ $? -eq 0 ] && [ $(running_systemd) -eq 0 ]; then
|
||||||
systemctl start mariadb.service
|
systemctl start mariadb.service
|
||||||
else
|
else
|
||||||
/usr/bin/mysqld_safe --skip-grant-tables &
|
/usr/bin/mysqld_safe --skip-grant-tables &
|
||||||
@@ -87,7 +96,7 @@ if [ $? -ne 0 ]; then
|
|||||||
echo "ERROR: Invalid password in .my.cnf, or Columnstore plugin install missing"
|
echo "ERROR: Invalid password in .my.cnf, or Columnstore plugin install missing"
|
||||||
# Test we are using systemd
|
# Test we are using systemd
|
||||||
systemctl cat mariadb.service > /dev/null 2>&1
|
systemctl cat mariadb.service > /dev/null 2>&1
|
||||||
if [ $? -eq 0 ]; then
|
if [ $? -eq 0 ] && [ $(running_systemd) -eq 0 ]; then
|
||||||
systemctl stop mariadb.service > /dev/null 2>&1
|
systemctl stop mariadb.service > /dev/null 2>&1
|
||||||
else
|
else
|
||||||
pkill mysqld
|
pkill mysqld
|
||||||
@@ -98,7 +107,7 @@ fi
|
|||||||
|
|
||||||
# Test we are using systemd
|
# Test we are using systemd
|
||||||
systemctl cat mariadb.service > /dev/null 2>&1
|
systemctl cat mariadb.service > /dev/null 2>&1
|
||||||
if [ $? -eq 0 ]; then
|
if [ $? -eq 0 ] && [ $(running_systemd) -eq 0 ]; then
|
||||||
systemctl stop mariadb.service > /dev/null 2>&1
|
systemctl stop mariadb.service > /dev/null 2>&1
|
||||||
else
|
else
|
||||||
pkill mysqld
|
pkill mysqld
|
||||||
|
Reference in New Issue
Block a user