Make start-sandbox sed -e MYSQLD in the start script in case mysqld isn't in basedir/bin.

This commit is contained in:
Daniel Nichter
2012-11-16 12:04:47 -07:00
parent 6e0abc12f0
commit 3e687ec69a
2 changed files with 8 additions and 7 deletions

View File

@@ -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.

View File

@@ -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