summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorGeorgi Kodinov <joro@sun.com>2009-08-19 10:59:17 +0300
committerGeorgi Kodinov <joro@sun.com>2009-08-19 10:59:17 +0300
commit40defb1d53e6978bdfcd4fc67f638cb56fa58ebb (patch)
treed9cb6f1114d4934bbc3a7c8adc313f974b717039 /scripts
parent171cb67d0f4d567665c2dd2646e7e9a49a9a644c (diff)
downloadmariadb-git-40defb1d53e6978bdfcd4fc67f638cb56fa58ebb.tar.gz
backport of Chad's fix for bug #39326 to 5.0-bugteam
Diffstat (limited to 'scripts')
-rw-r--r--scripts/mysqld_safe.sh24
1 files changed, 19 insertions, 5 deletions
diff --git a/scripts/mysqld_safe.sh b/scripts/mysqld_safe.sh
index e6b015e7d16..71b833c80cf 100644
--- a/scripts/mysqld_safe.sh
+++ b/scripts/mysqld_safe.sh
@@ -113,16 +113,27 @@ parse_arguments() {
MY_PWD=`pwd`
# Check for the directories we would expect from a binary release install
-if test -f ./share/mysql/english/errmsg.sys -a -x ./bin/mysqld
+if test -n "$MY_BASEDIR_VERSION" -a -d "$MY_BASEDIR_VERSION"
+then
+ # BASEDIR is already overridden on command line. Do not re-set.
+
+ # Use BASEDIR to discover le.
+ if test -x "$MY_BASEDIR_VERSION/libexec/mysqld"
+ then
+ ledir="$MY_BASEDIR_VERSION/libexec"
+ else
+ ledir="$MY_BASEDIR_VERSION/bin"
+ fi
+elif test -f ./share/mysql/english/errmsg.sys -a -x "$MY_PWD/bin/mysqld"
then
MY_BASEDIR_VERSION=$MY_PWD # Where bin, share and data are
ledir=$MY_BASEDIR_VERSION/bin # Where mysqld is
+ ledir="$MY_PWD/bin" # Where mysqld is
# Check for the directories we would expect from a source install
-elif test -f ./share/mysql/english/errmsg.sys -a \
- -x ./libexec/mysqld
+elif test -f ./share/mysql/english/errmsg.sys -a -x "$MY_PWD/libexec/mysqld"
then
MY_BASEDIR_VERSION=$MY_PWD # Where libexec, share and var are
- ledir=$MY_BASEDIR_VERSION/libexec # Where mysqld is
+ ledir="$MY_PWD/libexec" # Where mysqld is
# Since we didn't find anything, used the compiled-in defaults
else
MY_BASEDIR_VERSION=@prefix@
@@ -181,7 +192,10 @@ err_log=
# Get first arguments from the my.cnf file, groups [mysqld] and [mysqld_safe]
# and then merge with the command line arguments
-if test -x ./bin/my_print_defaults
+if test -x "$MY_BASEDIR_VERSION/bin/my_print_defaults"
+then
+ print_defaults="$MY_BASEDIR_VERSION/bin/my_print_defaults"
+elif test -x ./bin/my_print_defaults
then
print_defaults="./bin/my_print_defaults"
elif test -x @bindir@/my_print_defaults