← Back to team overview

maria-developers team mailing list archive

Re: Files under /etc/my.cnf.d/ read by default

 

On 02/06/2013 09:33 PM, Sergei Golubchik wrote:
Hi, Honza!

On Feb 05, Honza Horak wrote:
Hi guys,

while we were packaging MariaDB into Fedora (finally) we used the
upstream's cnf files structure, which means /etc/my.cnf, that includes
all files from directory /etc/my.cnf.d/* using statement !includedir.

That works fine when user installs (not updates) the MariaDB packages
without having them installed before. The problem is if user has changed
/etc/my.cnf before updating -- then /etc/my.cnf doesn't get updated
(!includedir won't be added) and we end with files under /etc/my.cnf.d/*
but nothing what includes them. That is quite confusing for users that
may change something in /etc/my.cnf.d/client.cnf but nothing happens.

Agree. Especially as we've started to use /etc/my.cnf.d/ now - e.g.
CassandraSE comes in a separate rpm, that (besides the plugin itself)
drops a file into /etc/my.cnf.d/ to enable the engine in the server.
I expect that more separately-packed plugins will start doing the same.

Since files under /etc/my.cnf.d/* are empty by default it shouldn't do
any harm if all files corresponding with /etc/my.cnf.d/*.cnf template
get loaded even without !includedir in /etc/my.cnf. Actually I believe
that is what users expect to happen when they see files under
/etc/my.cnf.d..

So, that's basically what I'm proposing -- read files under
/etc/my.cnf.d/* by default, without a need to use !includedir. What do
you think?

What if we add !includedir to the /etc/my.cnf from the post-inst script?
Something like

   grep -q '!includedir /etc/my.cnf.d' /etc/my.cnf || \
     (echo; echo '!includedir /etc/my.cnf.d') >> /etc/my.cnf

Would that be enough?

Thanks for that idea. It would work, but honestly I'm not sure if we want touch my.cnf during update. I've shared this idea with other fedora developers to collect their opinions -- feel free to join the discussion at:

http://lists.fedoraproject.org/pipermail/devel/2013-February/178475.html

Regards,
Honza




References