Commit 58c571a4 authored by unknown's avatar unknown

Fix problem with mysqladmin logging to var/log before var has been created

And if var/ has been created, it will be recreated later so the logs
from "mtr_kill_leftovers" will be lost anyway  


mysql-test/mysql-test-run.pl:
  Don't create vardir before mtr_kill_leftovers
mysql-test/lib/mtr_process.pl:
  Send output - if any - from mysqladmin to stdout/stderr. There shouldn't
  be any such errors and if any occur, it's good to know about them.
parent f4fc2207
...@@ -708,7 +708,7 @@ sub mtr_wait_blocking($) { ...@@ -708,7 +708,7 @@ sub mtr_wait_blocking($) {
} }
} }
# Start "mysqladmin shutdown" for a specific mysqld # Start "mysqladmin <command>" for a specific mysqld
sub mtr_mysqladmin_start($$$) { sub mtr_mysqladmin_start($$$) {
my $srv= shift; my $srv= shift;
my $command= shift; my $command= shift;
...@@ -738,9 +738,8 @@ sub mtr_mysqladmin_start($$$) { ...@@ -738,9 +738,8 @@ sub mtr_mysqladmin_start($$$) {
# Shutdown time must be high as slave may be in reconnect # Shutdown time must be high as slave may be in reconnect
mtr_add_arg($args, "--shutdown_timeout=$adm_shutdown_tmo"); mtr_add_arg($args, "--shutdown_timeout=$adm_shutdown_tmo");
mtr_add_arg($args, "$command"); mtr_add_arg($args, "$command");
my $path_mysqladmin_log= "$::opt_vardir/log/mysqladmin.log";
my $pid= mtr_spawn($::exe_mysqladmin, $args, my $pid= mtr_spawn($::exe_mysqladmin, $args,
"", $path_mysqladmin_log, $path_mysqladmin_log, "", "", "", "", "",
{ append_log_file => 1 }); { append_log_file => 1 });
mtr_verbose("mtr_mysqladmin_start, pid: $pid"); mtr_verbose("mtr_mysqladmin_start, pid: $pid");
return $pid; return $pid;
......
...@@ -1887,19 +1887,6 @@ sub kill_running_servers () { ...@@ -1887,19 +1887,6 @@ sub kill_running_servers () {
# This is different from terminating processes we have # This is different from terminating processes we have
# started from this run of the script, this is terminating # started from this run of the script, this is terminating
# leftovers from previous runs. # leftovers from previous runs.
if ( ! -d $opt_vardir )
{
if ( -l $opt_vardir and ! -d readlink($opt_vardir) )
{
mtr_report("Removing $opt_vardir symlink without destination");
unlink($opt_vardir);
}
# The "var" dir does not exist already
# the processes that mtr_kill_leftovers start will write
# their log files to var/log so it should be created
mkpath("$opt_vardir/log");
}
mtr_kill_leftovers(); mtr_kill_leftovers();
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment