diff options
author | Jonathan Perkin <jonathan.perkin@oracle.com> | 2010-07-05 22:19:14 +0100 |
---|---|---|
committer | Jonathan Perkin <jonathan.perkin@oracle.com> | 2010-07-05 22:19:14 +0100 |
commit | d38280afb6e8b69f75e62deba50b094ea730d19f (patch) | |
tree | 0c42469006d7324f2a14e972f29ea7f237931927 /scripts | |
parent | 2a64ad9a5a1d4e0f3e38ead39daf4fc9d8bbaf4e (diff) | |
download | mariadb-git-d38280afb6e8b69f75e62deba50b094ea730d19f.tar.gz |
We can't rely on mysql_config for core functionality like plugins
as it may be part of a separate package.
Work out the likliest plugin directory using similar logic to the
data directory, and avoid the dependancy.
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/mysqld_safe.sh | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/scripts/mysqld_safe.sh b/scripts/mysqld_safe.sh index d96091b685a..a537bf27aad 100644 --- a/scripts/mysqld_safe.sh +++ b/scripts/mysqld_safe.sh @@ -413,6 +413,29 @@ else DATADIR=@localstatedir@ fi +# +# Try to find the plugin directory +# + +# Use user-supplied argument +if [ -n "${PLUGIN_DIR}" ]; then + plugin_dir="${PLUGIN_DIR}" +else + # Try to find plugin dir relative to basedir + for dir in lib/mysql/plugin lib/plugin + do + if [ -d "${MY_BASEDIR_VERSION}/${dir}" ]; then + plugin_dir="${MY_BASEDIR_VERSION}/${dir}" + break + fi + done + # Give up and use compiled-in default + if [ -z "${plugin_dir}" ]; then + plugin_dir='@pkgplugindir@' + fi +fi +plugin_dir="${plugin_dir}${PLUGIN_VARIANT}" + if test -z "$MYSQL_HOME" then if test -r "$MY_BASEDIR_VERSION/my.cnf" && test -r "$DATADIR/my.cnf" @@ -704,8 +727,6 @@ fi cmd="`mysqld_ld_preload_text`$NOHUP_NICENESS" -plugin_dir="${PLUGIN_DIR:-`get_mysql_config --variable=plugindir`}${PLUGIN_VARIANT}" - for i in "$ledir/$MYSQLD" "$defaults" "--basedir=$MY_BASEDIR_VERSION" \ "--datadir=$DATADIR" "--plugin-dir=$plugin_dir" "$USER_OPTION" do |