summaryrefslogtreecommitdiff
path: root/scripts/mysqld_safe.sh
diff options
context:
space:
mode:
authorjimw@mysql.com <>2005-07-19 11:05:49 -0700
committerjimw@mysql.com <>2005-07-19 11:05:49 -0700
commit80c1c6b33f27d37d9bf4e7bba103e10377da5c01 (patch)
tree04692d95c000bd65df72b0a4c5c605b71afa5287 /scripts/mysqld_safe.sh
parentf40ac0bb9915501f74964c9edcd57deaa241ee61 (diff)
parentbb6918e3120fbf8d20c11a91c96f3236b4ea387d (diff)
downloadmariadb-git-80c1c6b33f27d37d9bf4e7bba103e10377da5c01.tar.gz
Merge mysql.com:/home/jimw/my/mysql-4.1-clean
into mysql.com:/home/jimw/my/mysql-5.0-clean
Diffstat (limited to 'scripts/mysqld_safe.sh')
-rw-r--r--scripts/mysqld_safe.sh38
1 files changed, 28 insertions, 10 deletions
diff --git a/scripts/mysqld_safe.sh b/scripts/mysqld_safe.sh
index 3a06c4d1fb5..873aff251db 100644
--- a/scripts/mysqld_safe.sh
+++ b/scripts/mysqld_safe.sh
@@ -106,29 +106,47 @@ parse_arguments() {
}
+#
+# First, try to find BASEDIR and ledir (where mysqld is)
+#
+
MY_PWD=`pwd`
-# Check if we are starting this relative (for the binary release)
-if test -f ./share/mysql/english/errmsg.sys -a \
- -x ./bin/mysqld
+# Check for the directories we would expect from a binary release install
+if test -f ./share/mysql/english/errmsg.sys -a -x ./bin/mysqld
then
MY_BASEDIR_VERSION=$MY_PWD # Where bin, share and data are
ledir=$MY_BASEDIR_VERSION/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
+then
+ MY_BASEDIR_VERSION=$MY_PWD # Where libexec, share and var are
+ ledir=$MY_BASEDIR_VERSION/libexec # Where mysqld is
+# Since we didn't find anything, used the compiled-in defaults
+else
+ MY_BASEDIR_VERSION=@prefix@
+ ledir=@libexecdir@
+fi
+
+#
+# Second, try to find the data directory
+#
+
+# Try where the binary installs put it
+if test -d $MY_BASEDIR_VERSION/data/mysql
+then
DATADIR=$MY_BASEDIR_VERSION/data
if test -z "$defaults" -a -r "$DATADIR/my.cnf"
then
defaults="--defaults-extra-file=$DATADIR/my.cnf"
fi
-# Check if this is a 'moved install directory'
-elif test -f ./share/mysql/english/errmsg.sys -a \
- -x ./libexec/mysqld
+# Next try where the source installs put it
+elif test -d $MY_BASEDIR_VERSION/var/mysql
then
- MY_BASEDIR_VERSION=$MY_PWD # Where libexec, share and var are
- ledir=$MY_BASEDIR_VERSION/libexec # Where mysqld is
DATADIR=$MY_BASEDIR_VERSION/var
+# Or just give up and use our compiled-in default
else
- MY_BASEDIR_VERSION=@prefix@
DATADIR=@localstatedir@
- ledir=@libexecdir@
fi
if test -z "$MYSQL_HOME"