summaryrefslogtreecommitdiff
path: root/scripts/mysqld_multi.sh
diff options
context:
space:
mode:
authorunknown <monty@mishka.local>2004-04-26 15:53:31 +0300
committerunknown <monty@mishka.local>2004-04-26 15:53:31 +0300
commit196b976ec127201ff873d8ca95b51b0a78fcd988 (patch)
tree25e3315af05fa92d20d2ad1d812882957c400337 /scripts/mysqld_multi.sh
parentfc67a82899a640859306f5d59213d0b7e837a63a (diff)
parentaab529aba5f0cdae53f91ee2ecb4463ef892f02f (diff)
downloadmariadb-git-196b976ec127201ff873d8ca95b51b0a78fcd988.tar.gz
Merge with 4.0
innobase/dict/dict0boot.c: Auto merged innobase/dict/dict0load.c: Auto merged innobase/dict/dict0mem.c: Auto merged innobase/fut/fut0lst.c: Auto merged innobase/include/buf0lru.h: Auto merged innobase/include/dict0mem.h: Auto merged innobase/include/fsp0fsp.h: Auto merged innobase/include/ha0ha.h: Auto merged innobase/include/ibuf0ibuf.h: Auto merged innobase/include/lock0lock.h: Auto merged innobase/include/log0log.h: Auto merged innobase/include/mem0pool.h: Auto merged innobase/include/mtr0mtr.h: Auto merged innobase/include/os0file.h: Auto merged innobase/include/rem0rec.h: Auto merged innobase/include/rem0rec.ic: Auto merged innobase/include/srv0srv.h: Auto merged innobase/include/sync0sync.h: Auto merged innobase/include/trx0sys.h: Auto merged innobase/include/ut0byte.h: Auto merged innobase/include/ut0ut.h: Auto merged innobase/mem/mem0pool.c: Auto merged innobase/mtr/mtr0mtr.c: Auto merged innobase/os/os0proc.c: Auto merged innobase/pars/lexyy.c: Auto merged innobase/pars/pars0opt.c: Auto merged innobase/row/row0ins.c: Auto merged innobase/row/row0purge.c: Auto merged innobase/row/row0uins.c: Auto merged innobase/row/row0umod.c: Auto merged innobase/row/row0undo.c: Auto merged innobase/row/row0upd.c: Auto merged innobase/trx/trx0purge.c: Auto merged innobase/trx/trx0roll.c: Auto merged innobase/trx/trx0sys.c: Auto merged innobase/trx/trx0undo.c: Auto merged innobase/ut/ut0byte.c: Auto merged pstack/bucomm.h: Auto merged pstack/budbg.h: Auto merged sql/item_sum.h: Auto merged sql/slave.cc: Auto merged sql/sql_db.cc: Auto merged support-files/mysql.spec.sh: Auto merged tests/insert_test.c: Auto merged mysql-test/t/func_group.test: Merge with 4.0 Put 4.1 tests lasts sql/ha_innodb.cc: Merge with 4.0 Added checking of results from my_malloc() BitKeeper/etc/logging_ok: Logging to logging@openlogging.org accepted
Diffstat (limited to 'scripts/mysqld_multi.sh')
-rw-r--r--scripts/mysqld_multi.sh80
1 files changed, 70 insertions, 10 deletions
diff --git a/scripts/mysqld_multi.sh b/scripts/mysqld_multi.sh
index b30d521c093..9767976460c 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.6";
+$VER="2.7";
$opt_config_file = undef();
$opt_example = 0;
@@ -47,11 +47,35 @@ sub main
print "MySQL distribution.\n";
$my_print_defaults_exists= 0;
}
- my @defops = `my_print_defaults mysqld_multi`;
- chop @defops;
- splice @ARGV, 0, 0, @defops;
+ if ($my_print_defaults_exists)
+ {
+ foreach my $arg (@ARGV)
+ {
+ if ($arg =~ m/^--config-file=(.*)/)
+ {
+ if (!length($1))
+ {
+ die "Option config-file requires an argument\n";
+ }
+ elsif (!( -e $1 && -r $1))
+ {
+ die "Option file '$1' doesn't exists, or is not readable\n";
+ }
+ else
+ {
+ $opt_config_file= $1;
+ }
+ }
+ }
+ my $com= "my_print_defaults ";
+ $com.= "--config-file=$opt_config_file " if (defined($opt_config_file));
+ $com.= "mysqld_multi";
+ my @defops = `$com`;
+ 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")
+ "config-file=s","user=s","password=s","log=s","no-log","tcp-ip")
|| die "Wrong option! See $my_progname --help for detailed information!\n";
init_log();
@@ -156,6 +180,45 @@ sub init_log
}
####
+#### Init log file. Check for appropriate place for log file, in the following
+#### order my_print_defaults mysqld datadir, @datadir@, /var/log, /tmp
+####
+
+sub init_log
+{
+ if ($my_print_defaults_exists)
+ {
+ @mysqld_opts= `my_print_defaults mysqld`;
+ chomp @mysqld_opts;
+ foreach my $opt (@mysqld_opts)
+ {
+ if ($opt =~ m/^\-\-datadir[=](.*)/)
+ {
+ if (-d "$1" && -w "$1")
+ {
+ $logdir= $1;
+ }
+ }
+ }
+ }
+ if (!defined($logdir))
+ {
+ $logdir= "@datadir@" if (-d "@datadir@" && -w "@datadir@");
+ }
+ if (!defined($logdir))
+ {
+ # Log file was not specified and we could not log to a standard place,
+ # so log file be disabled for now.
+ print "WARNING: Log file disabled. Maybe directory/file isn't writable?\n";
+ $opt_no_log= 1;
+ }
+ else
+ {
+ $opt_log= "$logdir/mysqld_multi.log";
+ }
+}
+
+####
#### Report living and not running MySQL servers
####
@@ -632,12 +695,9 @@ reported. Note that you must not have any white spaces in the GNR
list. Anything after a white space are ignored.
Options:
---config-file=... Alternative config file. NOTE: This will not affect
- this program's own options (group [mysqld_multi]),
- but only groups [mysqld#]. Without this option everything
- will be searched from the ordinary my.cnf file.
+--config-file=... Alternative config file.
Using: $opt_config_file
---example Give an example of a config file. (PLEASE DO CHECK THIS!)
+--example Give an example of a config file.
--help Print this help and exit.
--log=... Log file. Full path to and the name for the log file. NOTE:
If the file exists, everything will be appended.