Details
Description
If the default /etc/my.cnf file has been modified, removing the MariaDB-Server RPM will change /etc/my.cnf to /etc/my.cnf.rpm.save:
[root@dev-160-18 ~]# rpm -e --noscripts --nodeps $(rpm -qa | grep MariaDB) warning: /etc/my.cnf saved as /etc/my.cnf.rpmsave [root@dev-160-18 ~]#
This is unexpected behavior, as Oracle MySQL packages do not do this (tested with Oracle MySQL 5.6.13). Oracle MySQL will leave the /etc/my.cnf file alone:
[root@dev-160-18 ~]# rpm -e --nodeps $(rpm -qa|grep MySQL) [root@dev-160-18 ~]# ls -la /etc/my* -rw-r--r--. 1 root root 281 Aug 27 06:16 /etc/my.cnf [root@dev-160-18 ~]#
It was suggested that the "no replace" option be specified in the RPM spec file. But I don't know about packaging so that might not be the correct configuration option.
Thanks!
Gliffy Diagrams
Attachments
Activity
- All
- Comments
- Work Log
- History
- Activity
- Transitions
MySQL 5.6.5's spec file has:
%ghost %config(noreplace,missingok) %{_sysconfdir}/my.cnf
You may or may not want to behave the same but at least:
%config(noreplace) %{_sysconfdir}/my.cnf
Looking at some postfix packages I built some time ago I used a similar:
%attr(0644, root, root) %verify(not md5 size mtime) %config(noreplace) %{_sysconfdir}/postfix/main.cf
The intention should be clear: do not overwrite a configuration file once it exists...