From 9ccd55466d1384865768663dd6bf2b04e11ba774 Mon Sep 17 00:00:00 2001 From: Terje Rosten Date: Tue, 6 Dec 2016 08:35:26 +0100 Subject: BUG#13788154 INIT.D MYSQL SCRIPT CREATED BY MYSQL SOLARIS PACKAGE FAILS TO RUN DUE TO USE OF PIDOF pidof is Linuxism, prefer pgrep on other UNIX systems. --- support-files/CMakeLists.txt | 7 ++++++- support-files/mysql.server.sh | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) (limited to 'support-files') diff --git a/support-files/CMakeLists.txt b/support-files/CMakeLists.txt index 6aef51a5c16..924f08dfc83 100644 --- a/support-files/CMakeLists.txt +++ b/support-files/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2006, 2014, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2006, 2016, Oracle and/or its affiliates. All rights reserved. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -48,6 +48,11 @@ FOREACH(inifile my-huge my-innodb-heavy-4G my-large my-medium my-small) ENDFOREACH() IF(UNIX) + IF(CMAKE_SYSTEM_NAME MATCHES "Linux") + SET (PIDOF "pidof") + ELSE() + SET (PIDOF "pgrep -d' ' -f") + ENDIF() SET(prefix ${CMAKE_INSTALL_PREFIX}) FOREACH(script mysqld_multi.server mysql-log-rotate binary-configure config.medium.ini config.small.ini config.huge.ini ndb-config-2-node.ini) diff --git a/support-files/mysql.server.sh b/support-files/mysql.server.sh index 909d33f8770..cb13d2f10ba 100644 --- a/support-files/mysql.server.sh +++ b/support-files/mysql.server.sh @@ -359,7 +359,7 @@ case "$mode" in fi else # Try to find appropriate mysqld process - mysqld_pid=`pidof $libexecdir/mysqld` + mysqld_pid=`@PIDOF@ $libexecdir/mysqld` # test if multiple pids exist pid_count=`echo $mysqld_pid | wc -w` -- cgit v1.2.1 From b7f33d22d8f1af07deac57a3d51ac750788b812f Mon Sep 17 00:00:00 2001 From: Terje Rosten Date: Mon, 13 Feb 2017 14:55:29 +0100 Subject: Bug#25144379 MYSQLD PROCESS DOES NOT INCLUDE FULL PATH WHEN STARTING MYSQL SERVER Fix of Bug#25088048 caused paths to be relative, not absolute, this proved to be problematic. Fix is to still ignore current working directory, however switch to using full path of basedir, which is set to parent directory of bin/ directory where mysqld_safe is located. References to legacy tool mysql_print_defaults are removed, only my_print_defaults is used these days. This will also fix: Bug#11745176 (11192) MYSQLD_SAFE ONLY EVALUATES --DEFAULTS-FILE OPTION WHEN IT IS THE FIRST OP Bug#23013510 (80866) MYSQLD_SAFE SHOULD NOT SEARCH $MY_BASEDIR_VERSION/VAR AS DATADIR Bug#25244898 (84173) MYSQLD_SAFE --NO-DEFAULTS & SILENTLY DOES NOT WORK ANY MORE Bug#25261472 (84219) INITSCRIPT ERRORS WHEN LAUCHING MYSQLD_SAFE IN NON DEFAULT BASEDIR Bug#25319392 (84263) MYSQL.SERVER (MYSQL SERVER STARTUP SCRIPT) CAN NOT WORK,AND EXPORT SOME ERROR. Bug#25319457 MYSQLD_SAFE MIGHT FAIL IF $DATADIR HAS TRAILING / Bug#25341981 MYSQLD_SAFE ASSUMES INCORRECT BASEDIR WHEN EXECUTED WITH ABSOLUTE PATH Bug#25356221 (84427) MYSQLD_SAFE FAILS TO START WHEN USING A FIFO FOR LOG-ERROR (REGRESSION) Bug#25365194 (84447) MYSQLD_SAFE DOESN'T CHECK EXISTENCE OF GIVEN BASEDIR PARAMETER Bug#25377815 ERRORS WHILE STARTING MYSQLD_SAFE WITH SYM LINK ENABLED --- support-files/mysql.server.sh | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) (limited to 'support-files') diff --git a/support-files/mysql.server.sh b/support-files/mysql.server.sh index cb13d2f10ba..a2781ce3338 100644 --- a/support-files/mysql.server.sh +++ b/support-files/mysql.server.sh @@ -200,15 +200,8 @@ wait_for_pid () { # Get arguments from the my.cnf file, # the only group, which is read from now on is [mysqld] -if test -x ./bin/my_print_defaults -then - print_defaults="./bin/my_print_defaults" -elif test -x $bindir/my_print_defaults -then +if test -x "$bindir/my_print_defaults"; then print_defaults="$bindir/my_print_defaults" -elif test -x $bindir/mysql_print_defaults -then - print_defaults="$bindir/mysql_print_defaults" else # Try to find basedir in /etc/my.cnf conf=/etc/my.cnf @@ -225,11 +218,6 @@ else print_defaults="$d/bin/my_print_defaults" break fi - if test -x "$d/bin/mysql_print_defaults" - then - print_defaults="$d/bin/mysql_print_defaults" - break - fi done fi -- cgit v1.2.1