summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexey Bychko <alexey.bychko@mariadb.com>2021-09-22 18:08:50 +0700
committerAlexey Bychko <alexey.bychko@mariadb.com>2021-09-24 15:02:47 +0700
commit467011bcac3b3f42ae6f21dde8d88e78708b21d1 (patch)
treecf5178bd867a2f3b0918cd1cd1ebe1a37a725967
parent47ba5523046094db33e68c92a182491a629bbd56 (diff)
downloadmariadb-git-467011bcac3b3f42ae6f21dde8d88e78708b21d1.tar.gz
MDEV-26612 Two different ways to start MariaDB service can cause data corruptionbb-10.2-MDEV-26612
RedHat systems have both files for lsb and init functions. Old code was written as if/else, so second file (RedHat-specific) was not processed. So, systemd redirect didn't work, because its logic is described in RedHat-specific functions file
-rw-r--r--support-files/mysql.server.sh15
1 files changed, 7 insertions, 8 deletions
diff --git a/support-files/mysql.server.sh b/support-files/mysql.server.sh
index 6eb2d0bc257..7f034601539 100644
--- a/support-files/mysql.server.sh
+++ b/support-files/mysql.server.sh
@@ -91,16 +91,15 @@ datadir_set=
#
# Use LSB init script functions for printing messages, if possible
-#
+# Include non-LSB RedHat init functions to make systemctl redirect work
+init_functions="/etc/init.d/functions"
lsb_functions="/lib/lsb/init-functions"
-if test -f $lsb_functions ; then
+if test -f $lsb_functions; then
. $lsb_functions
-else
- # Include non-LSB RedHat init functions to make systemctl redirect work
- init_functions="/etc/init.d/functions"
- if test -f $init_functions; then
- . $init_functions
- fi
+fi
+
+if test -f $init_functions; then
+ . $init_functions
log_success_msg()
{
echo " SUCCESS! $@"