[Maria-developers] MariaDB 10/trunk (re)install destructively overwrites existing my.cnf* @ spec'd SYSCONFDIR
![](https://secure.gravatar.com/avatar/59b9a9117317400b5acce30b3fb51d35.jpg?s=120&d=mm&r=g)
Hi, I've a custom my.cnf ls -al /usr/local/etc/mariadb/my.cnf -rw-r--r--+ 1 root root 7.9K Jul 13 13:03 /usr/local/etc/mariadb/my.cnf If I (re)install mariadb 10/trunk from a src build with SYSCONFDIR spec'd for that dir, as done similarly to a MySQL build, cd mariadb/bld cmake .. \ ... -DINSTALL_SYSCONFDIR=/usr/local/etc/mariadb \ ... make make install The INSTALL process *destructively* overwrites the existing my.cnf ... -- Up-to-date: /usr/local/etc/mariadb/logrotate.d/mysql -- Up-to-date: /usr/local/etc/mariadb/init.d/mysql -- Installing: /usr/local/etc/mariadb/my.cnf <================================ !! -- Up-to-date: /usr/local/etc/mariadb/my.cnf.d/client.cnf -- Up-to-date: /usr/local/etc/mariadb/my.cnf.d/mysql-clients.cnf -- Up-to-date: /usr/local/etc/mariadb/my.cnf.d/server.cnf ... with an older default cnf, ls -al /usr/local/etc/mariadb/my.cnf -rw-r--r--+ 1 root root 202 Jul 12 11:31 /usr/local/etc/mariadb/my.cnf with no backup made of the existing cnf, find /usr/local/etc/mariadb -type f -name 'my.cnf*' /usr/local/etc/mariadb/my.cnf This is critically different behavior that MySQL. If that's intended, how are we to exec a mariadb install without overwriting our config files/dirs? If it's not, I suspect this should be fixed. Thanks.
![](https://secure.gravatar.com/avatar/6b1cecb6596aaa9fe497d5bd2bb2f5c1.jpg?s=120&d=mm&r=g)
-----Original Message----- From: Maria-developers [mailto:maria-developers- bounces+wlad=montyprogram.com@lists.launchpad.net] On Behalf Of darx@sent.com Sent: Samstag, 13. Juli 2013 22:18 To: maria-developers@lists.launchpad.net Subject: [Maria-developers] MariaDB 10/trunk (re)install destructively overwrites existing my.cnf* @ spec'd SYSCONFDIR
Hi,
I've a custom my.cnf
ls -al /usr/local/etc/mariadb/my.cnf -rw-r--r--+ 1 root root 7.9K Jul 13 13:03 /usr/local/etc/mariadb/my.cnf
If I (re)install mariadb 10/trunk from a src build with SYSCONFDIR spec'd for that dir, as done similarly to a MySQL build,
cd mariadb/bld cmake .. \ ... -DINSTALL_SYSCONFDIR=/usr/local/etc/mariadb \ ... make make install
No, MYSQL does not understand INSTALL_SYSCONFDIR. This is MariaDB specific option, and it is solely used to build RPMs. If it is used, some files are copied some files into the directory specified as INSTALL_SYSCONFDIR (this should not come as surprise?) . Since CMake based "make install" will ever make backup copies of existing files, and just overwrite existing files, and yes, it will overwrite your my.cnf However, If you just wish to specify additional directory to look for my.cnf, but not to create my.cnf during installation - I guess this is what you're after- then you should use DEFAULT_SYSCONFDIR instead. It will work with MySQL and with MariaDB and this is what lands in config.h (as seen in config.h.cmake template in the root source directory). No files will be installed if you set only this option.
The INSTALL process *destructively* overwrites the existing my.cnf
If that's intended, how are we to exec a mariadb install without overwriting our config files/dirs?
Yes, intended. INSTALL_SYSCONFDIR will install some files, my.cnf among them.
![](https://secure.gravatar.com/avatar/59b9a9117317400b5acce30b3fb51d35.jpg?s=120&d=mm&r=g)
On Sat, Jul 13, 2013, at 03:24 PM, Vladislav Vaintroub wrote:
No, MYSQL does not understand INSTALL_SYSCONFDIR.
My bad. You're absolutely right. It understands/uses: -DSYSCONFDIR=/usr/local/etc/mysql \ cat INSTALL-SOURCE ... * -DSYSCONFDIR=dir_name The default my.cnf option file directory. This location cannot be set at server startup, but you can start the server with a given option file using the --defaults-file=file_name option, where file_name is the full path name to the file. ...
However, If you just wish to specify additional directory to look for my.cnf, but not to create my.cnf during installation - I guess this is what you're after- then you should use DEFAULT_SYSCONFDIR instead. It will work with MySQL and with MariaDB and this is what lands in config.h (as seen in config.h.cmake template in the root source directory). No files will be installed if you set only this option.
There's no trace of DEFAULT_SYSCONFDIR in my MySQL source, just the SYSCONFDIR as above. I suspect it's the same. But, I did find it in the MariaDB tree. Hadn't looked past the INSTALL_SYSCONFDIR I'd originally found. :-/ Since I want BOTH convenient access to the latest build's default configs, AND to have 'my' working files left along, a combination of -DDEFAULT_SYSCONFDIR=/usr/local/etc/mariadb \ -DINSTALL_SYSCONFDIR=/usr/local/etc/mariadb.DEFAULT \ works quite nicely with MariaDB for me. Thanks for clarifying!
participants (2)
-
darx@sent.com
-
Vladislav Vaintroub