diff options
author | pem@mysql.com <> | 2004-05-07 18:52:06 +0200 |
---|---|---|
committer | pem@mysql.com <> | 2004-05-07 18:52:06 +0200 |
commit | bf45960eef96dba7e7a7ffc8c3bfe6627daee2a3 (patch) | |
tree | 2f7b236a8721d14f1b398964b898d922fd133131 /scripts | |
parent | e1182c5226ce1c5f5aff4c1e59798b9d3dccde2a (diff) | |
parent | df8e3eac456b14b420f724e658eee175d2ee5e57 (diff) | |
download | mariadb-git-bf45960eef96dba7e7a7ffc8c3bfe6627daee2a3.tar.gz |
Merge 4.1 -> 5.0
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/make_binary_distribution.sh | 14 | ||||
-rw-r--r-- | scripts/mysql_install_db.sh | 31 | ||||
-rw-r--r-- | scripts/mysqld_multi.sh | 90 | ||||
-rw-r--r-- | scripts/mysqld_safe.sh | 2 |
4 files changed, 107 insertions, 30 deletions
diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index c7cd56b3430..0d36fa2affe 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -17,6 +17,7 @@ DEBUG=0 SILENT=0 TMP=/tmp SUFFIX="" +NDBCLUSTER= parse_arguments() { for arg do @@ -26,6 +27,7 @@ parse_arguments() { --suffix=*) SUFFIX=`echo "$arg" | sed -e "s;--suffix=;;"` ;; --no-strip) STRIP=0 ;; --silent) SILENT=1 ;; + --with-ndbcluster) NDBCLUSTER=1 ;; *) echo "Unknown argument '$arg'" exit 1 @@ -264,6 +266,18 @@ if [ -d $BASE/sql-bench/SCCS ] ; then find $BASE/sql-bench -name SCCS -print | xargs rm -r -f fi +# NDB Cluster +if [ x$NDBCLUSTER = x1 ]; then + if [ ! -f ndb/BinDist.sh ]; then + echo "Missing ndb/BinDist.sh"; exit 1 + fi + mkdir $BASE/ndb || exit 1 + # assume we have cpio.. + if (cd ndb && sh BinDist.sh | cpio -pdm $BASE/ndb); then :; else + echo "Copy failed - missing files in ndb/BinDist.sh ?"; exit 1 + fi +fi + # Change the distribution to a long descriptive name NEW_NAME=mysql@MYSQL_SERVER_SUFFIX@-$version-$system-$machine$SUFFIX BASE2=$TMP/$NEW_NAME diff --git a/scripts/mysql_install_db.sh b/scripts/mysql_install_db.sh index 1861e8c52f8..61d173aac05 100644 --- a/scripts/mysql_install_db.sh +++ b/scripts/mysql_install_db.sh @@ -200,15 +200,28 @@ if test "$in_rpm" -eq 0 -a "$windows" -eq 0 then echo "Installing all prepared tables" fi -if ( - $scriptdir/mysql_create_system_tables $create_option $mdata $hostname $windows - if test -n "$fill_help_tables" - then - cat $fill_help_tables - fi -) | eval "$mysqld $defaults $mysqld_opt --bootstrap --skip-grant-tables \ - --basedir=$basedir --datadir=$ldata --skip-innodb --skip-bdb $args" +mysqld_install_cmd_line="$mysqld $defaults $mysqld_opt --bootstrap \ +--skip-grant-tables --basedir=$basedir --datadir=$ldata --skip-innodb \ +--skip-bdb $args" +if $scriptdir/mysql_create_system_tables $create_option $mdata $hostname $windows \ + | eval "$mysqld_install_cmd_line" then + if test -n "$fill_help_tables" + then + if test "$in_rpm" -eq 0 -a "$windows" -eq 0 + then + echo "Fill help tables" + fi + if ! (echo "use mysql; + " + cat $fill_help_tables) | eval "$mysqld_install_cmd_line" + then + echo "" + echo "WARNING: HELP FILES ARE NOT COMPLETELY INSTALLED!" + echo "The \"HELP\" command might not work properly" + echo "" + fi + fi if test "$in_rpm" = 0 -a "$windows" = 0 then echo "" @@ -250,7 +263,7 @@ then fi exit 0 else - echo "Installation of grant tables failed!" + echo "Installation of system tables failed!" echo echo "Examine the logs in $ldata for more information." echo "You can also try to start the mysqld daemon with:" diff --git a/scripts/mysqld_multi.sh b/scripts/mysqld_multi.sh index a4f2b18fda8..9767976460c 100644 --- a/scripts/mysqld_multi.sh +++ b/scripts/mysqld_multi.sh @@ -4,12 +4,12 @@ use Getopt::Long; use POSIX qw(strftime); $|=1; -$VER="2.6"; +$VER="2.7"; $opt_config_file = undef(); $opt_example = 0; $opt_help = 0; -$opt_log = ""; +$opt_log = undef(); $opt_mysqladmin = "@bindir@/mysqladmin"; $opt_mysqld = "@libexecdir@/mysqld"; $opt_no_log = 0; @@ -47,16 +47,39 @@ sub main print "MySQL distribution.\n"; $my_print_defaults_exists= 0; } - init_log(); - 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(); $groupids = $ARGV[1]; - if ($opt_version) { print "$my_progname version $VER by Jani Tolonen\n"; @@ -145,20 +168,48 @@ sub init_log } if (!defined($logdir)) { - $logdir= "/var/log" if (-d "/var/log" && -w "/var/log"); + # 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; } - if (!defined($logdir)) - { - if (-d "/tmp" && -w "/tmp" && ! -e "/tmp/mysqld_multi.log") + else + { + $opt_log= "$logdir/mysqld_multi.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) { - $logdir= "/tmp"; + if ($opt =~ m/^\-\-datadir[=](.*)/) + { + if (-d "$1" && -w "$1") + { + $logdir= $1; + } + } } } if (!defined($logdir)) { - # We still couldn't get a default log file in place. Log file - # will be disabled unless user sets it with an option - + $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 @@ -644,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. diff --git a/scripts/mysqld_safe.sh b/scripts/mysqld_safe.sh index 0f415ccd5f0..779438e75c3 100644 --- a/scripts/mysqld_safe.sh +++ b/scripts/mysqld_safe.sh @@ -162,6 +162,8 @@ then echo "Please do a cd to the mysql installation directory and restart" echo "this script from there as follows:" echo "./bin/mysqld_safe". + echo "See http://dev.mysql.com/doc/mysql/en/mysqld_safe.html for more" + echo "information" exit 1 fi |