From f4d4f22e9c5ed9938a81a7134044c41a74d1f6c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Dor=C5=88=C3=A1k?= Date: Thu, 26 May 2016 16:16:11 +0200 Subject: [PATCH] Fix mysql-prepare-db-dir Resolves: #1335849 --- mariadb.spec | 6 +++++- mysql-prepare-db-dir.sh | 4 ++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/mariadb.spec b/mariadb.spec index 7d9e3cd..69df542 100644 --- a/mariadb.spec +++ b/mariadb.spec @@ -123,7 +123,7 @@ Name: mariadb Version: %{compatver}.%{bugfixver} -Release: 1%{?with_debug:.debug}%{?dist} +Release: 2%{?with_debug:.debug}%{?dist} Epoch: 1 Summary: A community developed branch of MySQL @@ -1284,6 +1284,10 @@ fi %endif %changelog +* Thu May 26 2016 Jakub Dorňák - 1:10.1.14-2 +- Fix mysql-prepare-db-dir + Resolves: #1335849 + * Thu May 12 2016 Jakub Dorňák - 1:10.1.14-1 - Add selinux policy - Update to 10.1.14 (includes various bug fixes) diff --git a/mysql-prepare-db-dir.sh b/mysql-prepare-db-dir.sh index 1905f09..1873c1f 100644 --- a/mysql-prepare-db-dir.sh +++ b/mysql-prepare-db-dir.sh @@ -55,8 +55,8 @@ chown "$myuser:$mygroup" "$errlogfile" chmod 0640 "$errlogfile" [ -x /sbin/restorecon ] && /sbin/restorecon "$errlogfile" -# Make the data directory -if [ ! -d "$datadir/mysql" ] ; then +# Make the data directory if doesn't exist or empty +if ! ls $datadir/* &>/dev/null; then # First, make sure $datadir is there with correct permissions # (note: if it's not, and we're not root, this'll fail ...) if [ ! -e "$datadir" -a ! -h "$datadir" ]