Bug#22361702 - /USR/BIN/MYSQL-SYSTEMD-START DOES NOT RETURN CONTROL TO COMMAND LINE

If the configuration files contains multiple datadir lines, use the last datadir
entry in the RPM installation scripts
This commit is contained in:
Balasubramanian Kandasamy 2015-12-16 12:03:04 +05:30
parent c5ba706791
commit 3c9ba967af
4 changed files with 4 additions and 4 deletions

View File

@ -12,7 +12,7 @@ get_option () {
local section=$1
local option=$2
local default=$3
ret=$(/usr/bin/my_print_defaults $section | grep '^--'${option}'=' | cut -d= -f2-)
ret=$(/usr/bin/my_print_defaults $section | grep '^--'${option}'=' | cut -d= -f2- | tail -n 1)
[ -z "$ret" ] && ret=$default
echo $ret
}

View File

@ -626,7 +626,7 @@ rm -r $(readlink var) var
-c "MySQL Server" -u 27 mysql >/dev/null 2>&1 || :
%post server
datadir=$(/usr/bin/my_print_defaults server mysqld | grep '^--datadir=' | sed -n 's/--datadir=//p')
datadir=$(/usr/bin/my_print_defaults server mysqld | grep '^--datadir=' | sed -n 's/--datadir=//p' | tail -n 1)
/bin/chmod 0755 "$datadir"
/bin/touch /var/log/mysqld.log
%if 0%{?systemd}

View File

@ -10,7 +10,7 @@
install_db () {
# Note: something different than datadir=/var/lib/mysql requires SELinux policy changes (in enforcing mode)
datadir=$(/usr/bin/my_print_defaults server mysqld | grep '^--datadir=' | sed -n 's/--datadir=//p')
datadir=$(/usr/bin/my_print_defaults server mysqld | grep '^--datadir=' | sed -n 's/--datadir=//p' | tail -n 1)
# Restore log, dir, perms and SELinux contexts
[ -d "$datadir" ] || install -d -m 0755 -omysql -gmysql "$datadir" || exit 1

View File

@ -489,7 +489,7 @@ rm -r $(readlink var) var
-c "MySQL Server" -u 60 mysql >/dev/null 2>&1 || :
%post server
datadir=$(/usr/bin/my_print_defaults server mysqld | grep '^--datadir=' | sed -n 's/--datadir=//p')
datadir=$(/usr/bin/my_print_defaults server mysqld | grep '^--datadir=' | sed -n 's/--datadir=//p' | tail -n 1)
/bin/chmod 0755 "$datadir"
/bin/touch /var/log/mysql/mysqld.log
%if 0%{?systemd}