diff options
author | Nirbhay Choubey <nirbhay@mariadb.com> | 2015-10-31 18:07:02 -0400 |
---|---|---|
committer | Nirbhay Choubey <nirbhay@mariadb.com> | 2015-10-31 18:07:02 -0400 |
commit | 4d1511296288782df0e3d9373396724e250b24c1 (patch) | |
tree | 9fa47d141b71933859d6c2da585e5bb5e52db212 /support-files | |
parent | 17b0b45b1de41a1b188c5de6c3e9d8e6ecc48a72 (diff) | |
parent | d775ecdd010daad4dc6147fba58acd006bf2c60c (diff) | |
download | mariadb-git-4d1511296288782df0e3d9373396724e250b24c1.tar.gz |
Merge tag 'mariadb-10.0.22' into 10.0-galera
Diffstat (limited to 'support-files')
-rw-r--r-- | support-files/mysql.server.sh | 13 | ||||
-rw-r--r-- | support-files/mysql.spec.sh | 14 |
2 files changed, 11 insertions, 16 deletions
diff --git a/support-files/mysql.server.sh b/support-files/mysql.server.sh index 76a0622589e..c9398b6c020 100644 --- a/support-files/mysql.server.sh +++ b/support-files/mysql.server.sh @@ -123,12 +123,6 @@ mode=$1 # start or stop [ $# -ge 1 ] && shift - -other_args="$*" # uncommon, but needed when called from an RPM upgrade action - # Expected: "--skip-networking --skip-grant-tables" - # They are not checked here, intentionally, as it is the resposibility - # of the "spec" file author to give correct arguments only. - case `echo "testing\c"`,`echo -n testing` in *c*,-n*) echo_n= echo_c= ;; *c*,*) echo_n=-n echo_c= ;; @@ -220,6 +214,7 @@ else fi parse_server_arguments `$print_defaults $extra_args mysqld server mysql_server mysql.server` +parse_server_arguments "$@" # wait for the pid file to disappear wait_for_gone () { @@ -324,7 +319,7 @@ case "$mode" in then # Give extra arguments to mysqld with the my.cnf file. This script # may be overwritten at next upgrade. - $bindir/mysqld_safe --datadir="$datadir" --pid-file="$mysqld_pid_file_path" $other_args >/dev/null 2>&1 & + $bindir/mysqld_safe --datadir="$datadir" --pid-file="$mysqld_pid_file_path" "$@" >/dev/null 2>&1 & wait_for_ready; return_value=$? # Make lock for RedHat / SuSE @@ -372,8 +367,8 @@ case "$mode" in 'restart') # Stop the service and regardless of whether it was # running or not, start it again. - if $0 stop $other_args; then - if ! $0 start $other_args; then + if $0 stop "$@"; then + if ! $0 start "$@"; then log_failure_msg "Failed to restart server." exit 1 fi diff --git a/support-files/mysql.spec.sh b/support-files/mysql.spec.sh index ce8e56d4976..ed3b697c0f9 100644 --- a/support-files/mysql.spec.sh +++ b/support-files/mysql.spec.sh @@ -677,7 +677,7 @@ install -m 644 "%{malloc_lib_source}" \ # Check local settings to support them. if [ -x %{_bindir}/my_print_defaults ] then - mysql_datadir=`%{_bindir}/my_print_defaults server mysqld | grep '^--datadir=' | sed -n 's/--datadir=//p'` + mysql_datadir=`%{_bindir}/my_print_defaults server mysqld | grep '^--datadir=' | tail -1 | sed -n 's/--datadir=//p'` PID_FILE_PATT=`%{_bindir}/my_print_defaults server mysqld | grep '^--pid-file=' | sed -n 's/--pid-file=//p'` fi if [ -z "$mysql_datadir" ] @@ -782,7 +782,7 @@ esac STATUS_FILE=$mysql_datadir/RPM_UPGRADE_MARKER -if [ -f $STATUS_FILE ]; then +if [ -f "$STATUS_FILE" ]; then echo "Some previous upgrade was not finished:" ls -ld $STATUS_FILE echo "Please check its status, then do" @@ -853,7 +853,7 @@ fi # Check local settings to support them. if [ -x %{_bindir}/my_print_defaults ] then - mysql_datadir=`%{_bindir}/my_print_defaults server mysqld | grep '^--datadir=' | sed -n 's/--datadir=//p'` + mysql_datadir=`%{_bindir}/my_print_defaults server mysqld | grep '^--datadir=' | tail -1 | sed -n 's/--datadir=//p'` fi if [ -z "$mysql_datadir" ] then @@ -866,8 +866,8 @@ STATUS_FILE=$mysql_datadir/RPM_UPGRADE_MARKER # ---------------------------------------------------------------------- # Create data directory if needed, check whether upgrade or install # ---------------------------------------------------------------------- -if [ ! -d $mysql_datadir ] ; then mkdir -m 755 $mysql_datadir; fi -if [ -f $STATUS_FILE ] ; then +if [ ! -d "$mysql_datadir" ] ; then mkdir -m 755 "$mysql_datadir" ; fi +if [ -f "$STATUS_FILE" ] ; then SERVER_TO_START=`grep '^SERVER_TO_START=' $STATUS_FILE | cut -c17-` else SERVER_TO_START='' @@ -1045,7 +1045,7 @@ fi # Check local settings to support them. if [ -x %{_bindir}/my_print_defaults ] then - mysql_datadir=`%{_bindir}/my_print_defaults server mysqld | grep '^--datadir=' | sed -n 's/--datadir=//p'` + mysql_datadir=`%{_bindir}/my_print_defaults server mysqld | grep '^--datadir=' | tail -1 | sed -n 's/--datadir=//p'` fi if [ -z "$mysql_datadir" ] then @@ -1056,7 +1056,7 @@ NEW_VERSION=%{mysql_version}-%{release} STATUS_FILE=$mysql_datadir/RPM_UPGRADE_MARKER-LAST # Note the difference! STATUS_HISTORY=$mysql_datadir/RPM_UPGRADE_HISTORY -if [ -f $STATUS_FILE ] ; then +if [ -f "$STATUS_FILE" ] ; then SERVER_TO_START=`grep '^SERVER_TO_START=' $STATUS_FILE | cut -c17-` else # This should never happen, but let's be prepared |