summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorSergei Golubchik <sergii@pisem.net>2013-03-27 23:41:02 +0100
committerSergei Golubchik <sergii@pisem.net>2013-03-27 23:41:02 +0100
commit993ea79f2df42292eceeee394e8ece9f4a3f6cf2 (patch)
treed105c8288a89a25d412e9006b740c756db6326d6 /scripts
parent1827d9591e24ee469527021771088d842ab18374 (diff)
parent6599fd3e9c23a8957a63146cbe6a0ffc4c292a3d (diff)
downloadmariadb-git-993ea79f2df42292eceeee394e8ece9f4a3f6cf2.tar.gz
5.5 merge
Diffstat (limited to 'scripts')
-rw-r--r--scripts/mysql_install_db.sh2
-rw-r--r--scripts/mysqld_multi.sh2
-rw-r--r--scripts/mysqld_safe.sh15
-rw-r--r--scripts/mysqldumpslow.sh2
4 files changed, 14 insertions, 7 deletions
diff --git a/scripts/mysql_install_db.sh b/scripts/mysql_install_db.sh
index b28e8a3ba1c..241cb84a399 100644
--- a/scripts/mysql_install_db.sh
+++ b/scripts/mysql_install_db.sh
@@ -257,7 +257,7 @@ fi
# Now we can get arguments from the groups [mysqld] and [mysql_install_db]
# in the my.cfg file, then re-run to merge with command line arguments.
-parse_arguments `"$print_defaults" $defaults mysqld mariadb mysql_install_db client-server`
+parse_arguments `"$print_defaults" $defaults --mysqld mysql_install_db`
parse_arguments PICK-ARGS-FROM-ARGV "$@"
# Configure paths to support files
diff --git a/scripts/mysqld_multi.sh b/scripts/mysqld_multi.sh
index 81015746ae9..cd1b6fc18b7 100644
--- a/scripts/mysqld_multi.sh
+++ b/scripts/mysqld_multi.sh
@@ -237,7 +237,7 @@ sub defaults_for_group
sub init_log
{
- foreach my $opt (defaults_for_group('mysqld mariadb'))
+ foreach my $opt (defaults_for_group('--mysqld'))
{
if ($opt =~ m/^--datadir=(.*)/ && -d "$1" && -w "$1")
{
diff --git a/scripts/mysqld_safe.sh b/scripts/mysqld_safe.sh
index f49f885bf5a..572a08781c8 100644
--- a/scripts/mysqld_safe.sh
+++ b/scripts/mysqld_safe.sh
@@ -71,6 +71,7 @@ Usage: $0 [OPTIONS]
--defaults-extra-file=FILE Also use defaults from the specified file
--ledir=DIRECTORY Look for mysqld in the specified directory
--open-files-limit=LIMIT Limit the number of open files
+ --crash-script=FILE Script to call when mysqld crashes
--timezone=TZ Set the system timezone
--malloc-lib=LIB Preload shared library LIB if available
--mysqld=FILE Use the specified file as mysqld
@@ -202,6 +203,7 @@ parse_arguments() {
optname_subst=`echo "$optname" | sed 's/_/-/g'`
arg=`echo $arg | sed "s/^$optname/$optname_subst/"`
case "$arg" in
+ --crash-script=*) CRASH_SCRIPT="$val" ;;
# these get passed explicitly to mysqld
--basedir=*) MY_BASEDIR_VERSION="$val" ;;
--datadir=*|--data=*) DATADIR="$val" ;;
@@ -501,7 +503,7 @@ append_arg_to_args () {
args=
SET_USER=2
-parse_arguments `$print_defaults $defaults --loose-verbose mysqld mariadb server client-server`
+parse_arguments `$print_defaults $defaults --loose-verbose --mysqld`
if test $SET_USER -eq 2
then
SET_USER=0
@@ -585,7 +587,7 @@ then
log_notice "Logging to '$err_log'."
logging=file
- if [ ! -e "$err_log" ]; then # if error log already exists,
+ if [ ! -f "$err_log" ]; then # if error log already exists,
touch "$err_log" # we just append. otherwise,
chmod "$fmode" "$err_log" # fix the permissions here!
fi
@@ -799,13 +801,13 @@ have_sleep=1
while true
do
- rm -f $safe_mysql_unix_port "$pid_file" # Some extra safety
+ rm -f "$pid_file" # Some extra safety
start_time=`date +%M%S`
eval_log_error "$cmd"
- if [ $want_syslog -eq 0 -a ! -e "$err_log" ]; then
+ if [ $want_syslog -eq 0 -a ! -f "$err_log" ]; then
touch "$err_log" # hypothetical: log was renamed but not
chown $user "$err_log" # flushed yet. we'd recreate it with
chmod "$fmode" "$err_log" # wrong owner next time we log, so set
@@ -874,6 +876,11 @@ do
done
fi
log_notice "mysqld restarted"
+ if test -n "$CRASH_SCRIPT"
+ then
+ crash_script_output=`$CRASH_SCRIPT 2>&1`
+ log_error "$crash_script_output"
+ fi
done
log_notice "mysqld from pid file $pid_file ended"
diff --git a/scripts/mysqldumpslow.sh b/scripts/mysqldumpslow.sh
index 0de4fe159f0..c04ffad7457 100644
--- a/scripts/mysqldumpslow.sh
+++ b/scripts/mysqldumpslow.sh
@@ -53,7 +53,7 @@ GetOptions(\%opt,
$opt{'help'} and usage();
unless (@ARGV) {
- my $defaults = `my_print_defaults mysqld mariadb`;
+ my $defaults = `my_print_defaults --mysqld`;
my $datadir = ($defaults =~ m/--datadir=(.*)/g)[-1];
if (!$datadir or $opt{i}) {