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
This commit is contained in:
James Slagle 2014-08-08 14:12:32 -04:00
parent 4311b1c147
commit b3b83f5299

View File

@ -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