summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorunknown <tomas@poseidon.ndb.mysql.com>2005-05-02 13:18:26 +0200
committerunknown <tomas@poseidon.ndb.mysql.com>2005-05-02 13:18:26 +0200
commit5326bdc616ca307942f646e8e28cfa838555377d (patch)
tree3e17ad766a1ecabf2eda4cd41b97efb6367c627e /scripts
parent9bfa6d1afa296ffbf1404d058572dc9554434651 (diff)
parent21eed96b0261a6c6eff4f8df1493a0e57decf2bb (diff)
downloadmariadb-git-5326bdc616ca307942f646e8e28cfa838555377d.tar.gz
Merge tulin@bk-internal.mysql.com:/home/bk/mysql-5.0
into poseidon.ndb.mysql.com:/home/tomas/mysql-5.1-clean BitKeeper/etc/logging_ok: auto-union configure.in: Auto merged sql/ha_innodb.cc: Auto merged sql/ha_myisam.cc: Auto merged sql/ha_myisammrg.cc: Auto merged sql/lock.cc: Auto merged sql/mysql_priv.h: Auto merged sql/mysqld.cc: Auto merged sql/sql_parse.cc: Auto merged sql/sql_repl.cc: Auto merged storage/heap/hp_hash.c: Auto merged storage/innobase/dict/dict0dict.c: Auto merged storage/innobase/fil/fil0fil.c: Auto merged storage/innobase/include/dict0dict.h: Auto merged storage/myisam/Makefile.am: Auto merged storage/myisam/mi_key.c: Auto merged storage/myisam/myisampack.c: Auto merged storage/myisammrg/myrg_open.c: Auto merged storage/ndb/include/ndbapi/NdbDictionary.hpp: Auto merged storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp: Auto merged storage/ndb/src/ndbapi/ndberror.c: Auto merged
Diffstat (limited to 'scripts')
-rw-r--r--scripts/Makefile.am2
-rw-r--r--scripts/mysqld_multi.sh58
-rw-r--r--scripts/mysqld_safe.sh2
3 files changed, 50 insertions, 12 deletions
diff --git a/scripts/Makefile.am b/scripts/Makefile.am
index 82a4fc2ca92..b2fef9acadf 100644
--- a/scripts/Makefile.am
+++ b/scripts/Makefile.am
@@ -135,7 +135,7 @@ SUFFIXES = .sh
-e 's!@''MYSQLD_DEFAULT_SWITCHES''@!@MYSQLD_DEFAULT_SWITCHES@!' \
-e 's!@''MYSQL_UNIX_ADDR''@!@MYSQL_UNIX_ADDR@!' \
-e 's!@''MYSQL_TCP_PORT''@!@MYSQL_TCP_PORT@!' \
- -e 's!@''IS_LINUX''@!@IS_LINUX@!' \
+ -e 's!@''TARGET_LINUX''@!@TARGET_LINUX@!' \
-e "s!@""CONF_COMMAND""@!@CONF_COMMAND@!" \
-e 's!@''MYSQLD_USER''@!@MYSQLD_USER@!' \
-e 's!@''STATIC_NSS_FLAGS''@!@STATIC_NSS_FLAGS@!' \
diff --git a/scripts/mysqld_multi.sh b/scripts/mysqld_multi.sh
index ee873a86c8d..642772bca44 100644
--- a/scripts/mysqld_multi.sh
+++ b/scripts/mysqld_multi.sh
@@ -4,7 +4,7 @@ use Getopt::Long;
use POSIX qw(strftime);
$|=1;
-$VER="2.12";
+$VER="2.14";
$opt_config_file = undef();
$opt_example = 0;
@@ -37,13 +37,13 @@ main();
sub main
{
- my ($flag_exit);
+ my $flag_exit= 0;
if (!defined(my_which(my_print_defaults)))
{
# We can't throw out yet, since --version, --help, or --example may
# have been given
- print "WARNING! my_print_defaults command not found!\n";
+ print "WARNING: my_print_defaults command not found.\n";
print "Please make sure you have this command available and\n";
print "in your path. The command is available from the latest\n";
print "MySQL distribution.\n";
@@ -66,6 +66,11 @@ sub main
else
{
$opt_config_file= $1;
+ if (!($opt_config_file =~ m/\//))
+ {
+ # No path. Use current working directory
+ $opt_config_file= "./" . $opt_config_file;
+ }
}
}
}
@@ -76,10 +81,18 @@ sub main
chop @defops;
splice @ARGV, 0, 0, @defops;
}
- GetOptions("help","example","version","mysqld=s","mysqladmin=s",
- "config-file=s","user=s","password=s","log=s","no-log","tcp-ip",
- "silent","verbose")
- || die "Wrong option! See $my_progname --help for detailed information!\n";
+ if (!GetOptions("help","example","version","mysqld=s","mysqladmin=s",
+ "config-file=s","user=s","password=s","log=s","no-log",
+ "tcp-ip", "silent","verbose"))
+ {
+ $flag_exit= 1;
+ }
+ if (defined($opt_config_file) && !($opt_config_file =~ m/\//))
+ {
+ # No path. Use current working directory
+ $opt_config_file= "./" . $opt_config_file;
+ }
+ usage() if ($opt_help);
if ($opt_verbose && $opt_silent)
{
@@ -95,15 +108,14 @@ sub main
exit(0);
}
example() if ($opt_example);
- usage() if ($opt_help);
if ($flag_exit)
{
- print "Error with an option, see $my_progname --help for more info!\n";
+ print "Error with an option, see $my_progname --help for more info.\n";
exit(1);
}
if (!defined(my_which(my_print_defaults)))
{
- print "ABORT: Can't find command 'my_print_defaults'!\n";
+ print "ABORT: Can't find command 'my_print_defaults'.\n";
print "This command is available from the latest MySQL\n";
print "distribution. Please make sure you have the command\n";
print "in your PATH.\n";
@@ -157,6 +169,31 @@ sub main
}
####
+#### Quote option argument. Add double quotes around the argument
+#### and escape the following: $, \, "
+#### This function is needed, because my_print_defaults drops possible
+#### quotes, single or double, from in front of an argument and from
+#### the end.
+####
+
+sub quote_opt_arg
+{
+ my ($option)= @_;
+
+ if ($option =~ m/(\-\-[a-zA-Z0-9\_\-]+)=(.*)/)
+ {
+ $option= $1;
+ $arg= $2;
+ $arg=~ s/\\/\\\\/g; # Escape escape character first to avoid doubling.
+ $arg=~ s/\$/\\\$/g;
+ $arg=~ s/\"/\\\"/g;
+ $arg= "\"" . $arg . "\"";
+ $option= $option . "=" . $arg;
+ }
+ return $option;
+}
+
+####
#### Init log file. Check for appropriate place for log file, in the following
#### order my_print_defaults mysqld datadir, @datadir@, /var/log, /tmp
####
@@ -290,6 +327,7 @@ sub start_mysqlds()
else
{
$options[$j]=~ s/;/\\;/g;
+ $options[$j]= quote_opt_arg($options[$j]);
$tmp.= " $options[$j]";
}
}
diff --git a/scripts/mysqld_safe.sh b/scripts/mysqld_safe.sh
index 10983d2850f..9ec573737bd 100644
--- a/scripts/mysqld_safe.sh
+++ b/scripts/mysqld_safe.sh
@@ -368,7 +368,7 @@ do
break
fi
- if @IS_LINUX@ && test $KILL_MYSQLD -eq 1
+ if @TARGET_LINUX@ && test $KILL_MYSQLD -eq 1
then
# Test if one process was hanging.
# This is only a fix for Linux (running as base 3 mysqld processes)