mirror of
https://github.com/percona/percona-toolkit.git
synced 2025-12-20 02:20:04 +08:00
Make start-sandbox sed -e MYSQLD in the start script in case mysqld isn't in basedir/bin.
This commit is contained in:
@@ -49,7 +49,7 @@ echo -n "Starting MySQL test server on port PORT... "
|
|||||||
# Start MySQL.
|
# Start MySQL.
|
||||||
cwd=$PWD
|
cwd=$PWD
|
||||||
cd $BASEDIR
|
cd $BASEDIR
|
||||||
$BASEDIR/bin/mysqld --defaults-file=/tmp/PORT/my.sandbox.cnf > /dev/null 2>&1 &
|
$BASEDIR/MYSQLD --defaults-file=/tmp/PORT/my.sandbox.cnf > /dev/null 2>&1 &
|
||||||
cd $PWD
|
cd $PWD
|
||||||
|
|
||||||
# Wait for MySQL to actually be up, i.e. to respond to queries.
|
# Wait for MySQL to actually be up, i.e. to respond to queries.
|
||||||
|
|||||||
@@ -66,6 +66,7 @@ make_sandbox() {
|
|||||||
sed -e "s/PORT/$port/g" -i.bak $file
|
sed -e "s/PORT/$port/g" -i.bak $file
|
||||||
# Use ! instead of / because the replacment has / (it's a directory)
|
# Use ! instead of / because the replacment has / (it's a directory)
|
||||||
sed -e "s!PERCONA_TOOLKIT_SANDBOX!$PERCONA_TOOLKIT_SANDBOX!g" -i.bak $file
|
sed -e "s!PERCONA_TOOLKIT_SANDBOX!$PERCONA_TOOLKIT_SANDBOX!g" -i.bak $file
|
||||||
|
sed -e "s!MYSQLD!$mysqld!g" -i.bak $file
|
||||||
done
|
done
|
||||||
rm /tmp/$port/*.bak >/dev/null 2>&1
|
rm /tmp/$port/*.bak >/dev/null 2>&1
|
||||||
|
|
||||||
@@ -186,15 +187,15 @@ fi
|
|||||||
# Get server version.
|
# Get server version.
|
||||||
# ###########################################################################
|
# ###########################################################################
|
||||||
if [ -x "$PERCONA_TOOLKIT_SANDBOX/bin/mysqld" ]; then
|
if [ -x "$PERCONA_TOOLKIT_SANDBOX/bin/mysqld" ]; then
|
||||||
mysqld="$PERCONA_TOOLKIT_SANDBOX/bin/mysqld"
|
mysqld="bin/mysqld"
|
||||||
elif [ -x "$PERCONA_TOOLKIT_SANDBOX/sbin/mysqld" ]; then
|
elif [ -x "sbin/mysqld" ]; then
|
||||||
mysqld="$PERCONA_TOOLKIT_SANDBOX/sbin/mysqld"
|
mysqld="sbin/mysqld"
|
||||||
elif [ -x "$PERCONA_TOOLKIT_SANDBOX/libexec/mysqld" ]; then
|
elif [ -x "libexec/mysqld" ]; then
|
||||||
mysqld="$PERCONA_TOOLKIT_SANDBOX/libexec/mysqld"
|
mysqld="libexec/mysqld"
|
||||||
else
|
else
|
||||||
die "Cannot find executable mysqld in $PERCONA_TOOLKIT_SANDBOX/bin, $PERCONA_TOOLKIT_SANDBOX/sbin or $PERCONA_TOOLKIT_SANDBOX/libexec."
|
die "Cannot find executable mysqld in $PERCONA_TOOLKIT_SANDBOX/bin, $PERCONA_TOOLKIT_SANDBOX/sbin or $PERCONA_TOOLKIT_SANDBOX/libexec."
|
||||||
fi
|
fi
|
||||||
version=`$mysqld -V 2>/dev/null | awk '{print $3}' | cut -d. -f 1,2`;
|
version=`$PERCONA_TOOLKIT_SANDBOX/$mysqld -V 2>/dev/null | awk '{print $3}' | cut -d. -f 1,2`;
|
||||||
if [ ! -d "$PERCONA_TOOLKIT_BRANCH/sandbox/servers/$version" ]; then
|
if [ ! -d "$PERCONA_TOOLKIT_BRANCH/sandbox/servers/$version" ]; then
|
||||||
die "$PERCONA_TOOLKIT_BRANCH/sandbox/servers/$version does not exist."
|
die "$PERCONA_TOOLKIT_BRANCH/sandbox/servers/$version does not exist."
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user