Skip to content

Commit 3c9ba96

Browse files
committed
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
1 parent c5ba706 commit 3c9ba96

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

packaging/rpm-oel/mysql-systemd-start

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ get_option () {
1212
local section=$1
1313
local option=$2
1414
local default=$3
15-
ret=$(/usr/bin/my_print_defaults $section | grep '^--'${option}'=' | cut -d= -f2-)
15+
ret=$(/usr/bin/my_print_defaults $section | grep '^--'${option}'=' | cut -d= -f2- | tail -n 1)
1616
[ -z "$ret" ] && ret=$default
1717
echo $ret
1818
}

packaging/rpm-oel/mysql.spec.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -626,7 +626,7 @@ rm -r $(readlink var) var
626626
-c "MySQL Server" -u 27 mysql >/dev/null 2>&1 || :
627627

628628
%post server
629-
datadir=$(/usr/bin/my_print_defaults server mysqld | grep '^--datadir=' | sed -n 's/--datadir=//p')
629+
datadir=$(/usr/bin/my_print_defaults server mysqld | grep '^--datadir=' | sed -n 's/--datadir=//p' | tail -n 1)
630630
/bin/chmod 0755 "$datadir"
631631
/bin/touch /var/log/mysqld.log
632632
%if 0%{?systemd}

packaging/rpm-sles/mysql-systemd-start

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
install_db () {
1212
# Note: something different than datadir=/var/lib/mysql requires SELinux policy changes (in enforcing mode)
13-
datadir=$(/usr/bin/my_print_defaults server mysqld | grep '^--datadir=' | sed -n 's/--datadir=//p')
13+
datadir=$(/usr/bin/my_print_defaults server mysqld | grep '^--datadir=' | sed -n 's/--datadir=//p' | tail -n 1)
1414

1515
# Restore log, dir, perms and SELinux contexts
1616
[ -d "$datadir" ] || install -d -m 0755 -omysql -gmysql "$datadir" || exit 1

packaging/rpm-sles/mysql.spec.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -489,7 +489,7 @@ rm -r $(readlink var) var
489489
-c "MySQL Server" -u 60 mysql >/dev/null 2>&1 || :
490490

491491
%post server
492-
datadir=$(/usr/bin/my_print_defaults server mysqld | grep '^--datadir=' | sed -n 's/--datadir=//p')
492+
datadir=$(/usr/bin/my_print_defaults server mysqld | grep '^--datadir=' | sed -n 's/--datadir=//p' | tail -n 1)
493493
/bin/chmod 0755 "$datadir"
494494
/bin/touch /var/log/mysql/mysqld.log
495495
%if 0%{?systemd}

0 commit comments

Comments
 (0)