Some more checks to avoid removing unwanted directories.

parent bccf1442
......@@ -1974,15 +1974,29 @@ sub remove_stale_vardir () {
sub setup_vardir() {
mtr_report("Creating Directories");
if ( $opt_mem )
if ( $opt_vardir eq $default_vardir )
{
#
# Running with "var" in mysql-test dir
#
if ( -l $opt_vardir )
{
# Runinng with var as a link to some "memory" location, normally tmpfs
# it's a symlink
# Make sure the directory where it points exist
mtr_error("The destination for symlink $opt_vardir does not exist")
if ! -d readlink($opt_vardir);
}
elsif ( $opt_mem )
{
# Runinng with "var" as a link to some "memory" location, normally tmpfs
mtr_verbose("Creating $opt_mem");
mkpath($opt_mem);
mtr_report("Symlinking 'var' to '$opt_mem'");
symlink($opt_mem, $opt_vardir);
}
}
mkpath("$opt_vardir/log");
mkpath("$opt_vardir/run");
......
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