Commit 2d78ef1d authored by Michael Widenius's avatar Michael Widenius

Added support for --crash-script in mysqld_safe.

Trivial cleanup

scripts/mysqld_safe.sh:
  Added support for --crash-script.
  Don't remove socket file (not needed as server will re-create it if needed)
  Patch by Eric Bergen
storage/maria/ha_maria.h:
  Removed not existing variable.
parent 2c97d5a3
...@@ -71,6 +71,7 @@ Usage: $0 [OPTIONS] ...@@ -71,6 +71,7 @@ Usage: $0 [OPTIONS]
--defaults-extra-file=FILE Also use defaults from the specified file --defaults-extra-file=FILE Also use defaults from the specified file
--ledir=DIRECTORY Look for mysqld in the specified directory --ledir=DIRECTORY Look for mysqld in the specified directory
--open-files-limit=LIMIT Limit the number of open files --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 --timezone=TZ Set the system timezone
--malloc-lib=LIB Preload shared library LIB if available --malloc-lib=LIB Preload shared library LIB if available
--mysqld=FILE Use the specified file as mysqld --mysqld=FILE Use the specified file as mysqld
...@@ -202,6 +203,7 @@ parse_arguments() { ...@@ -202,6 +203,7 @@ parse_arguments() {
optname_subst=`echo "$optname" | sed 's/_/-/g'` optname_subst=`echo "$optname" | sed 's/_/-/g'`
arg=`echo $arg | sed "s/^$optname/$optname_subst/"` arg=`echo $arg | sed "s/^$optname/$optname_subst/"`
case "$arg" in case "$arg" in
--crash-script=*) CRASH_SCRIPT="$val" ;;
# these get passed explicitly to mysqld # these get passed explicitly to mysqld
--basedir=*) MY_BASEDIR_VERSION="$val" ;; --basedir=*) MY_BASEDIR_VERSION="$val" ;;
--datadir=*|--data=*) DATADIR="$val" ;; --datadir=*|--data=*) DATADIR="$val" ;;
...@@ -799,7 +801,7 @@ have_sleep=1 ...@@ -799,7 +801,7 @@ have_sleep=1
while true while true
do do
rm -f $safe_mysql_unix_port "$pid_file" # Some extra safety rm -f "$pid_file" # Some extra safety
start_time=`date +%M%S` start_time=`date +%M%S`
...@@ -874,6 +876,11 @@ do ...@@ -874,6 +876,11 @@ do
done done
fi fi
log_notice "mysqld restarted" log_notice "mysqld restarted"
if test -n "$CRASH_SCRIPT"
then
crash_script_output=`$CRASH_SCRIPT 2>&1`
log_error "$crash_script_output"
fi
done done
log_notice "mysqld from pid file $pid_file ended" log_notice "mysqld from pid file $pid_file ended"
......
...@@ -35,7 +35,6 @@ C_MODE_START ...@@ -35,7 +35,6 @@ C_MODE_START
ICP_RESULT index_cond_func_maria(void *arg); ICP_RESULT index_cond_func_maria(void *arg);
C_MODE_END C_MODE_END
extern ulong maria_sort_buffer_size;
extern TYPELIB maria_recover_typelib; extern TYPELIB maria_recover_typelib;
extern ulonglong maria_recover_options; extern ulonglong maria_recover_options;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment