diff options
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/mysql_install_db.sh | 24 | ||||
-rw-r--r-- | scripts/wsrep_sst_mariabackup.sh | 6 | ||||
-rw-r--r-- | scripts/wsrep_sst_rsync.sh | 2 |
3 files changed, 23 insertions, 9 deletions
diff --git a/scripts/mysql_install_db.sh b/scripts/mysql_install_db.sh index 54b5bed4546..4ab486186f4 100644 --- a/scripts/mysql_install_db.sh +++ b/scripts/mysql_install_db.sh @@ -41,6 +41,9 @@ auth_root_authentication_method=socket auth_root_socket_user="" skip_test_db=0 +dirname0=`dirname $0 2>/dev/null` +dirname0=`dirname $dirname0 2>/dev/null` + usage() { cat <<EOF @@ -242,11 +245,6 @@ cannot_find_file() echo "If you don't want to do a full install, you can use the --srcdir" echo "option to only install the mysql database and privilege tables" echo - echo "If you compiled from source, you need to either run 'make install' to" - echo "copy the software into the correct location ready for operation." - echo "If you don't want to do a full install, you can use the --srcdir" - echo "option to only install the mysql database and privilege tables" - echo echo "If you are using a binary release, you must either be at the top" echo "level of the extracted archive, or pass the --basedir option" echo "pointing to that location." @@ -287,6 +285,9 @@ then cannot_find_file my_print_defaults $basedir/bin $basedir/extra exit 1 fi +elif test -n "$dirname0" -a -x "$dirname0/@bindir@/my_print_defaults" +then + print_defaults="$dirname0/@bindir@/my_print_defaults" else print_defaults="@bindir@/my_print_defaults" fi @@ -302,6 +303,8 @@ fi parse_arguments `"$print_defaults" $defaults $defaults_group_suffix --mysqld mysql_install_db` parse_arguments PICK-ARGS-FROM-ARGV "$@" +rel_mysqld="$dirname0/@INSTALL_SBINDIR@/mysqld" + # Configure paths to support files if test -n "$srcdir" then @@ -344,6 +347,17 @@ then fi plugindir=`find_in_dirs --dir auth_socket.so $basedir/lib*/plugin $basedir/lib*/mysql/plugin` pamtooldir=$plugindir +# relative from where the script was run for a relocatable install +elif test -n "$dirname0" -a -x "$rel_mysqld" -a ! "$rel_mysqld" -ef "@sbindir@/mysqld" +then + basedir="$dirname0" + bindir="$basedir/@INSTALL_BINDIR@" + resolveip="$bindir/resolveip" + mysqld="$rel_mysqld" + srcpkgdatadir="$basedir/@INSTALL_MYSQLSHAREDIR@" + buildpkgdatadir="$basedir/@INSTALL_MYSQLSHAREDIR@" + plugindir="$basedir/@INSTALL_PLUGINDIR@" + pamtooldir=$plugindir else basedir="@prefix@" bindir="@bindir@" diff --git a/scripts/wsrep_sst_mariabackup.sh b/scripts/wsrep_sst_mariabackup.sh index 1e018f1a515..b01833fe224 100644 --- a/scripts/wsrep_sst_mariabackup.sh +++ b/scripts/wsrep_sst_mariabackup.sh @@ -516,7 +516,7 @@ kill_xtrabackup() setup_ports() { if [[ "$WSREP_SST_OPT_ROLE" == "donor" ]];then - if [[ ${WSREP_SST_OPT_ADDR:0:1} == '[' ]];then + if [ "${WSREP_SST_OPT_ADDR#\[}" != "$WSREP_SST_OPT_ADDR" ]; then remain=$(echo $WSREP_SST_OPT_ADDR | awk -F '\\][:/]' '{ print $2 }') REMOTEIP=$(echo $WSREP_SST_OPT_ADDR | awk -F '\\]:' '{ print $1 }')"]" SST_PORT=$(echo $remain | awk -F '[:/]' '{ print $1 }') @@ -529,7 +529,7 @@ setup_ports() sst_ver=$(echo $WSREP_SST_OPT_ADDR | awk -F '[:/]' '{ print $5 }') fi else - if [[ ${WSREP_SST_OPT_ADDR:0:1} == '[' ]];then + if [ "${WSREP_SST_OPT_ADDR#\[}" != "$WSREP_SST_OPT_ADDR" ]; then SST_PORT=$(echo ${WSREP_SST_OPT_ADDR} | awk -F '\\]:' '{ print $2 }') else SST_PORT=$(echo ${WSREP_SST_OPT_ADDR} | awk -F ':' '{ print $2 }') @@ -972,7 +972,7 @@ then if [ -z "${SST_PORT}" ] then SST_PORT=4444 - if [[ ${ADDR:0:1} == '[' ]];then + if [ "${ADDR#\[}" != "$ADDR" ]; then ADDR="$(echo ${WSREP_SST_OPT_ADDR} | awk -F '\\]:' '{ print $1 }')]:${SST_PORT}" else ADDR="$(echo ${WSREP_SST_OPT_ADDR} | awk -F ':' '{ print $1 }'):${SST_PORT}" diff --git a/scripts/wsrep_sst_rsync.sh b/scripts/wsrep_sst_rsync.sh index 6a71d7bbfb3..e78beefce8f 100644 --- a/scripts/wsrep_sst_rsync.sh +++ b/scripts/wsrep_sst_rsync.sh @@ -400,7 +400,7 @@ then rm -rf "$RSYNC_PID" ADDR=$WSREP_SST_OPT_ADDR - if [[ ${ADDR:0:1} == '[' ]]; then + if [ "${ADDR#\[}" != "$ADDR" ]; then RSYNC_PORT=$(echo $ADDR | awk -F '\\]:' '{ print $2 }') RSYNC_ADDR=$(echo $ADDR | awk -F '\\]:' '{ print $1 }')"]" else |