1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-01 03:47:19 +03:00

Added --log-basename to mysqld to allow one to set the prefix for all logs with one command

Changed test suite to use --log-basename (to get the code tested)
Added --sync-sys=1 to test suite to speed it up.
Better error messages if something goes wrong with mysql_install_db


mysql-test/Makefile.am:
  Removed not existing directory
mysql-test/lib/My/ConfigFactory.pm:
  Use log-basename
  We had to also set 'log_error' as some test was explicitely using the old name
  Added 'sync-sys=1' to speed up test suite
mysql-test/r/variables-notembedded.result:
  Updated test results (variable relay_log is now set)
mysql-test/suite/binlog/t/binlog_delete_and_flush_index-master.opt:
  Force specific names for some log files.
mysql-test/suite/binlog/t/binlog_index-master.opt:
  Force specific names for some log files.
mysql-test/suite/binlog/t/binlog_stm_unsafe_warning-master.opt:
  Force specific names for some log files.
mysql-test/suite/binlog/t/binlog_stm_unsafe_warning.test:
  Better error message if something goes wrong
mysql-test/suite/rpl/r/rpl_flushlog_loop.result:
  Updated results
mysql-test/suite/rpl/rpl_1slave_base.cnf:
  Use --log-basename
scripts/mysql_install_db.sh:
  More information to --help
  Write url to knowledge base if something goes wrong
  Fail at once if we can't create a database directory (no reason to continue and write a screenful of not related text)
scripts/mysqld_safe.sh:
  Also allow one to use --data for --datadir (common shortening)
  Added support for --log-basename
  Fail at once if we can't create a log directory
  Fixed bug where we used a pid file name without '.pid' extension
sql/log.cc:
  Create a log file name trough my_once_alloc()  (To get it automaticly freed at exit)
sql/mysql_priv.h:
  Added new prototype
sql/mysqld.cc:
  Added support for --log-basename
  Better help for a lot of log-filename related variables.
sql/rpl_rli.cc:
  Write information that one can use --log-basename
sql/set_var.cc:
  Add log_basename as a readonly variable
This commit is contained in:
Michael Widenius
2011-03-23 17:59:41 +02:00
parent 0fae0335d4
commit 7de98f2ffb
16 changed files with 205 additions and 83 deletions

View File

@ -50,6 +50,8 @@ Usage: $0 [OPTIONS]
use hostnames will use IP addresses.
--ldata=path The path to the MariaDB data directory. Same as
--datadir.
--no-defaults Don't read any configuration files (my.cnf).
--defaults-file=path Read only this configuration file.
--rpm For internal use. This option is used by RPM files
during the MariaDB installation process.
--skip-name-resolve Use IP addresses rather than hostnames when creating
@ -79,6 +81,13 @@ s_echo()
fi
}
link_to_help()
{
echo
echo "The latest information about mysql_install_db is available at"
echo "http://kb.askmonty.org/v/installing-system-tables-mysql_install_db."
}
parse_arg()
{
echo "$1" | sed -e 's/^[^=]*=//'
@ -194,7 +203,7 @@ cannot_find_file()
echo "If you are using a binary release, you must either be at the top"
echo "level of the extracted archive, or pass the --basedir option"
echo "pointing to that location."
echo
link_to_help
}
# Ok, let's go. We first need to parse arguments which are required by
@ -213,6 +222,7 @@ parse_arguments PICK-ARGS-FROM-ARGV "$@"
if test -n "$srcdir" && test -n "$basedir"
then
echo "ERROR: Specify either --basedir or --srcdir, not both."
link_to_help
exit 1
fi
if test -n "$srcdir"
@ -335,6 +345,7 @@ then
echo "hostname."
echo "If you want to solve this at a later stage, restart this script"
echo "with the --force option"
link_to_help
exit 1
fi
echo "WARNING: The host '$hostname' could not be looked up with resolveip."
@ -356,7 +367,12 @@ for dir in $ldata $ldata/mysql $ldata/test
do
if test ! -d $dir
then
mkdir -p $dir
if ! `mkdir -p $dir`
then
echo "Fatal error Can't create database directory '$dir'"
link_to_help
exit 1
fi
chmod 700 $dir
fi
if test -w / -a ! -z "$user"
@ -389,7 +405,7 @@ mysqld_install_cmd_line="$mysqld_bootstrap $defaults $mysqld_opt --bootstrap \
--net_buffer_length=16K"
# Create the system and help tables by passing them to "mysqld --bootstrap"
s_echo "Installing MariaDB/MySQL system tables..."
s_echo "Installing MariaDB/MySQL system tables in '$ldata' ..."
if { echo "use mysql;"; cat $create_system_tables $fill_system_tables; } | eval "$filter_cmd_line" | $mysqld_install_cmd_line > /dev/null
then
s_echo "OK"
@ -410,9 +426,7 @@ else
echo
echo "Try 'mysqld --help' if you have problems with paths. Using"
echo "--general-log gives you a log in $ldata that may be helpful."
echo
echo "The latest information about mysql_install_db is available at"
echo "http://kb.askmonty.org/v/installing-system-tables-mysql_install_db."
link_to_help
echo "MariaDB is hosted on launchpad; You can find the latest source and"
echo "email lists at http://launchpad.net/maria"
echo
@ -454,13 +468,13 @@ then
echo "databases and anonymous user created by default. This is"
echo "strongly recommended for production servers."
echo
echo "See the MySQL manual for more instructions."
echo "See the MariaDB knowledge or the MySQL manual for more instructions."
if test "$in_rpm" -eq 0
then
echo
echo "You can start the MariaDB daemon with:"
echo "cd $basedir ; $bindir/mysqld_safe &"
echo "cd $basedir ; $bindir/mysqld_safe --datadir=$ldata"
echo
echo "You can test the MariaDB daemon with mysql-test-run.pl"
echo "cd $basedir/mysql-test ; perl mysql-test-run.pl"