summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorGeorgi Kodinov <joro@sun.com>2009-06-19 18:32:10 +0300
committerGeorgi Kodinov <joro@sun.com>2009-06-19 18:32:10 +0300
commita11f9409e1ff90b327819a4e9e1852c8c62c9381 (patch)
tree159ffe07848142efc9dd566efad567b5209ca7a9 /scripts
parent4662631f1d3c38d7a202055a665af81fc63d7b69 (diff)
parent014e28912587d19038549e18097feb0efa4489dc (diff)
downloadmariadb-git-a11f9409e1ff90b327819a4e9e1852c8c62c9381.tar.gz
automerge
Diffstat (limited to 'scripts')
-rw-r--r--scripts/mysqld_multi.sh20
1 files changed, 19 insertions, 1 deletions
diff --git a/scripts/mysqld_multi.sh b/scripts/mysqld_multi.sh
index f35be69c151..430c74874eb 100644
--- a/scripts/mysqld_multi.sh
+++ b/scripts/mysqld_multi.sh
@@ -1,7 +1,7 @@
#!/usr/bin/perl
use Getopt::Long;
-use POSIX qw(strftime);
+use POSIX qw(strftime getcwd);
$|=1;
$VER="2.16";
@@ -295,6 +295,7 @@ sub start_mysqlds()
{
@options = defaults_for_group($groups[$i]);
+ $basedir_found= 0; # The default
$mysqld_found= 1; # The default
$mysqld_found= 0 if (!length($mysqld));
$com= "$mysqld";
@@ -310,6 +311,14 @@ sub start_mysqlds()
$com= $options[$j];
$mysqld_found= 1;
}
+ elsif ("--basedir=" eq substr($options[$j], 0, 10))
+ {
+ $basedir= $options[$j];
+ $basedir =~ s/^--basedir=//;
+ $basedir_found= 1;
+ $options[$j]= quote_shell_word($options[$j]);
+ $tmp.= " $options[$j]";
+ }
else
{
$options[$j]= quote_shell_word($options[$j]);
@@ -337,7 +346,16 @@ sub start_mysqlds()
print "group [$groups[$i]] separately.\n";
exit(1);
}
+ if ($basedir_found)
+ {
+ $curdir=getcwd();
+ chdir($basedir) or die "Can't change to datadir $basedir";
+ }
system($com);
+ if ($basedir_found)
+ {
+ chdir($curdir) or die "Can't change back to original dir $curdir";
+ }
}
if (!$i && !$opt_no_log)
{