From b3b83f5299c1739dc4e40b65b7633ff7ac5a0b84 Mon Sep 17 00:00:00 2001 From: James Slagle Date: Fri, 8 Aug 2014 14:12:32 -0400 Subject: [PATCH] Symlink /etc/my.cnf instead of deleting it All of the existing mariadb elements install from packages. /etc/my.cnf is a packaged file, and it shouldn't be deleted as rpm does not provide a way to "mark" a file as intentionally deleted. Instead of deleting it, create a symlink to the config we actually use at /etc/mysql/my.cnf. Change-Id: I3909cd8fbd77a9121f4e3ba4d40eae799207bff9 --- elements/mariadb-common/install.d/11-mariadb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/elements/mariadb-common/install.d/11-mariadb b/elements/mariadb-common/install.d/11-mariadb index 00344396e..55dbcdbf7 100755 --- a/elements/mariadb-common/install.d/11-mariadb +++ b/elements/mariadb-common/install.d/11-mariadb @@ -16,8 +16,12 @@ fi if [ -e /etc/init/mysql.conf ]; then sed -i -e 's,/var/lib/mysql/,/mnt/state/var/lib/mysql/,g' /etc/init/mysql.conf fi + # Fedora/RHEL install /etc/my.cnf but we do not want any unmanaged configs -rm -f /etc/my.cnf +# mariadb elements install using packages, so we don't want to just delete this +# file, so symlink it to the config we actually use. +ln -f -s /etc/mysql/my.cnf /etc/my.cnf + # On openSUSE /var/lib/mysql is not part of the mariadb packages. [ -d /var/lib/mysql ] || install -d -o mysql -g root -m 0700 /var/lib/mysql register-state-path /var/lib/mysql