diff --git a/cmake/cpack_rpm.cmake b/cmake/cpack_rpm.cmake index 67b67d1fa76a6..7580f1325056d 100644 --- a/cmake/cpack_rpm.cmake +++ b/cmake/cpack_rpm.cmake @@ -88,7 +88,7 @@ It was originally forked from Percona XtraBackup 2.3.8.") # Packages with default description SET(CPACK_RPM_client_PACKAGE_SUMMARY "MariaDB database client binaries") SET(CPACK_RPM_client_PACKAGE_DESCRIPTION "${CPACK_RPM_PACKAGE_DESCRIPTION}") -SET(CPACK_RPM_common_PACKAGE_SUMMARY "MariaDB database common configuration files (e.g. /etc/mysql/conf.d/mariadb.cnf)") +SET(CPACK_RPM_common_PACKAGE_SUMMARY "MariaDB database common configuration files (e.g. /etc/mariadb/conf.d/mariadb.cnf)") SET(CPACK_RPM_common_PACKAGE_DESCRIPTION "${CPACK_RPM_PACKAGE_DESCRIPTION}") SET(CPACK_RPM_compat_PACKAGE_SUMMARY "MariaDB database client library MySQL compat package") SET(CPACK_RPM_compat_PACKAGE_DESCRIPTION "${CPACK_RPM_PACKAGE_DESCRIPTION}") diff --git a/cmake/install_layout.cmake b/cmake/install_layout.cmake index 0911fc94ea99b..a52f261891a21 100644 --- a/cmake/install_layout.cmake +++ b/cmake/install_layout.cmake @@ -42,7 +42,7 @@ # - INSTALL_SBINDIR (directory with mysqld) # - INSTALL_SCRIPTDIR (several scripts, rarely used) # - INSTALL_SYSCONFDIR (my.cnf config file. Usually /etc or nothing) -# - INSTALL_SYSCONF2DIR (additional config files, e.g. /etc/mysql/conf.d) +# - INSTALL_SYSCONF2DIR (additional config files, e.g. /etc/mariadb/conf.d) # # - INSTALL_LIBDIR (directory with client end embedded libraries) # - INSTALL_PLUGINDIR (directory for plugins) @@ -179,7 +179,7 @@ SET(INSTALL_BINDIR_DEB "bin") SET(INSTALL_SBINDIR_DEB "sbin") SET(INSTALL_SCRIPTDIR_DEB "bin") SET(INSTALL_SYSCONFDIR_DEB "/etc") -SET(INSTALL_SYSCONF2DIR_DEB "/etc/mysql/mariadb.conf.d") +SET(INSTALL_SYSCONF2DIR_DEB "/etc/mariadb/mariadb.conf.d") # SET(INSTALL_LIBDIR_DEB "lib/${CMAKE_CXX_LIBRARY_ARCHITECTURE}") SET(INSTALL_PLUGINDIR_DEB "lib/mysql/plugin") diff --git a/cmake/systemd.cmake b/cmake/systemd.cmake index a825cd0cb6809..c54c133e37547 100644 --- a/cmake/systemd.cmake +++ b/cmake/systemd.cmake @@ -50,7 +50,7 @@ MACRO(CHECK_SYSTEMD) SET(SYSTEMD_SCRIPTS ${SYSTEMD_SCRIPTS} galera_recovery) ENDIF() IF(DEB) - SET(SYSTEMD_EXECSTARTPOST "ExecStartPost=!/etc/mysql/debian-start") + SET(SYSTEMD_EXECSTARTPOST "ExecStartPost=!/etc/mariadb/debian-start") ENDIF() IF(URING_FOUND) SET(SYSTEMD_LIMIT "# For liburing and io_uring_setup() diff --git a/debian/additions/debian-start b/debian/additions/debian-start index 8c880f0312865..d13e03596920b 100755 --- a/debian/additions/debian-start +++ b/debian/additions/debian-start @@ -22,10 +22,10 @@ then . /etc/default/mariadb fi -MARIADB="/usr/bin/mariadb --defaults-extra-file=/etc/mysql/debian.cnf" -MYADMIN="/usr/bin/mariadb-admin --defaults-extra-file=/etc/mysql/debian.cnf" +MARIADB="/usr/bin/mariadb --defaults-extra-file=/etc/mariadb/debian.cnf" +MYADMIN="/usr/bin/mariadb-admin --defaults-extra-file=/etc/mariadb/debian.cnf" # Don't run full mariadb-upgrade on every server restart, use --version-check to do it only once -MYUPGRADE="/usr/bin/mariadb-upgrade --defaults-extra-file=/etc/mysql/debian.cnf --version-check --silent" +MYUPGRADE="/usr/bin/mariadb-upgrade --defaults-extra-file=/etc/mariadb/debian.cnf --version-check --silent" # The following commands should be run when the server is up but in background # where they do not block the server start and in one shell instance so that diff --git a/debian/additions/debian-start.inc.sh b/debian/additions/debian-start.inc.sh index 47f2b8a50a4f4..c5ade4bb3f9dd 100755 --- a/debian/additions/debian-start.inc.sh +++ b/debian/additions/debian-start.inc.sh @@ -1,6 +1,6 @@ #!/bin/bash # -# This file is included by /etc/mysql/debian-start +# This file is included by /etc/mariadb/debian-start # ## Check for tables needing an upgrade. diff --git a/debian/additions/mariadb.cnf b/debian/additions/mariadb.cnf index 95038f0496f16..ae514a8493e6d 100644 --- a/debian/additions/mariadb.cnf +++ b/debian/additions/mariadb.cnf @@ -1,11 +1,10 @@ # The MariaDB configuration file # -# The MariaDB/MySQL tools read configuration files in the following order: -# 0. "/etc/mysql/my.cnf" symlinks to this file, reason why all the rest is read. -# 1. "/etc/mysql/mariadb.cnf" (this file) to set global defaults, -# 2. "/etc/mysql/conf.d/*.cnf" to set global options. -# 3. "/etc/mysql/mariadb.conf.d/*.cnf" to set MariaDB-only options. -# 4. "~/.my.cnf" to set user-specific options. +# MariaDB reads configuration files in the following order: +# 0. "/etc/mariadb/my.cnf" (a symlink to this file) to set global defaults, +# 1. "/etc/mariadb/conf.d/*.cnf" to set global options, +# 2. "/etc/mariadb/mariadb.conf.d/*.cnf" to set MariaDB-only options, +# 3. "~/.my.cnf" to set user-specific options. # # If the same option is defined multiple times, the last one will apply. # @@ -25,5 +24,5 @@ socket = /run/mysqld/mysqld.sock # Import all .cnf files from configuration directory -!includedir /etc/mysql/conf.d/ -!includedir /etc/mysql/mariadb.conf.d/ +!includedir /etc/mariadb/conf.d/ +!includedir /etc/mariadb/mariadb.conf.d/ diff --git a/debian/additions/mariadb.conf.d/50-client.cnf b/debian/additions/mariadb.conf.d/50-client.cnf index 1fd4685df22c3..8e3a13235f7b6 100644 --- a/debian/additions/mariadb.conf.d/50-client.cnf +++ b/debian/additions/mariadb.conf.d/50-client.cnf @@ -5,14 +5,14 @@ [client] # Example of client certificate usage -#ssl-cert = /etc/mysql/client-cert.pem -#ssl-key = /etc/mysql/client-key.pem +#ssl-cert = /etc/mariadb/client-cert.pem +#ssl-key = /etc/mariadb/client-key.pem # # Allow only TLS encrypted connections #ssl-verify-server-cert = on # This group is *never* read by mysql client library, though this -# /etc/mysql/mariadb.cnf.d/client.cnf file is not read by Oracle MySQL +# /etc/mariadb/mariadb.cnf.d/client.cnf file is not read by Oracle MySQL # client anyway. # If you use the same .cnf file for MySQL and MariaDB, # use it for MariaDB-only client options diff --git a/debian/additions/mariadb.conf.d/50-server.cnf b/debian/additions/mariadb.conf.d/50-server.cnf index 722dc6b5ec87a..627beb61d5cc7 100644 --- a/debian/additions/mariadb.conf.d/50-server.cnf +++ b/debian/additions/mariadb.conf.d/50-server.cnf @@ -82,9 +82,9 @@ expire_logs_days = 10 # For documentation, please read # https://mariadb.com/docs/server/security/encryption/data-in-transit-encryption/securing-connections-for-client-and-server -#ssl-ca = /etc/mysql/cacert.pem -#ssl-cert = /etc/mysql/server-cert.pem -#ssl-key = /etc/mysql/server-key.pem +#ssl-ca = /etc/mariadb/cacert.pem +#ssl-cert = /etc/mariadb/server-cert.pem +#ssl-key = /etc/mariadb/server-key.pem #require-secure-transport = on # diff --git a/debian/additions/source_mariadb.py b/debian/additions/source_mariadb.py index a91695a704846..9b1c9efdfd377 100644 --- a/debian/additions/source_mariadb.py +++ b/debian/additions/source_mariadb.py @@ -37,11 +37,11 @@ def add_info(report): report[key] += line + '\n' attach_mac_events(report, '/usr/sbin/mariadbd') attach_file(report,'/etc/apparmor.d/usr.sbin.mariadbd') - _add_my_conf_files(report, '/etc/mysql/mariadb.cnf') - for f in os.listdir('/etc/mysql/conf.d'): - _add_my_conf_files(report, os.path.join('/etc/mysql/conf.d', f)) - for f in os.listdir('/etc/mysql/mariadb.conf.d'): - _add_my_conf_files(report, os.path.join('/etc/mysql/mariadb.conf.d', f)) + _add_my_conf_files(report, '/etc/mariadb/mariadb.cnf') + for f in os.listdir('/etc/mariadb/conf.d'): + _add_my_conf_files(report, os.path.join('/etc/mariadb/conf.d', f)) + for f in os.listdir('/etc/mariadb/mariadb.conf.d'): + _add_my_conf_files(report, os.path.join('/etc/mariadb/mariadb.conf.d', f)) try: report['MySQLVarLibDirListing'] = str(os.listdir('/var/lib/mysql')) except OSError: diff --git a/debian/control b/debian/control index df33235d82380..f25724d296508 100644 --- a/debian/control +++ b/debian/control @@ -273,26 +273,12 @@ Description: MariaDB embedded database, development files package This package includes the MariaDB embedded server library development and header files. -Package: mysql-common -Architecture: all -Depends: - ${misc:Depends}, -Description: MariaDB client common configuration files package (e.g. /etc/mysql/my.cnf) - MariaDB is a fast, stable and true multi-user, multi-threaded SQL database - server. SQL (Structured Query Language) is the most popular database query - language in the world. The main goals of MariaDB are speed, robustness and - ease of use. - . - This package includes files needed by all versions of the client library - (e.g. /etc/mysql/my.cnf). - Package: mariadb-common Architecture: all Depends: - mysql-common (>= 5.6.25), ${misc:Depends}, Multi-Arch: foreign -Description: MariaDB database common files (e.g. /etc/mysql/mariadb.conf.d/) +Description: MariaDB database common files (e.g. /etc/mariadb/mariadb.conf.d/) MariaDB is a fast, stable and true multi-user, multi-threaded SQL database server. SQL (Structured Query Language) is the most popular database query language in the world. The main goals of MariaDB are speed, robustness and diff --git a/debian/mariadb-client.README.Debian b/debian/mariadb-client.README.Debian index 64f0f50995107..bb66d7e2fd7cd 100644 --- a/debian/mariadb-client.README.Debian +++ b/debian/mariadb-client.README.Debian @@ -1,4 +1,4 @@ FAQ: Q: My completion is gone, why? -A: You have "no-auto-rehash" in the "[mysql]" section of /etc/mysql/my.cnf! +A: You have "no-auto-rehash" in the "[mysql]" section of /etc/mariadb/my.cnf! diff --git a/debian/mariadb-client.install b/debian/mariadb-client.install index 28d1c0dff2b66..b84ebd764a546 100644 --- a/debian/mariadb-client.install +++ b/debian/mariadb-client.install @@ -1,7 +1,7 @@ debian/additions/innotop/innotop usr/bin/ debian/additions/mariadb-report usr/bin/ -debian/additions/mariadb.conf.d/50-client.cnf etc/mysql/mariadb.conf.d -debian/additions/mariadb.conf.d/50-mariadb-clients.cnf etc/mysql/mariadb.conf.d +debian/additions/mariadb.conf.d/50-client.cnf etc/mariadb/mariadb.conf.d +debian/additions/mariadb.conf.d/50-mariadb-clients.cnf etc/mariadb/mariadb.conf.d usr/bin/mariadb-access usr/bin/mariadb-admin usr/bin/mariadb-binlog diff --git a/debian/mariadb-common.dirs b/debian/mariadb-common.dirs index 8aba95609771a..6d0699ba02bc7 100644 --- a/debian/mariadb-common.dirs +++ b/debian/mariadb-common.dirs @@ -1 +1,2 @@ -etc/mysql/mariadb.conf.d +etc/mariadb/mariadb.conf.d +etc/mariadb/conf.d diff --git a/debian/mariadb-common.install b/debian/mariadb-common.install index 611c7d4d36ee5..38bd9e0150b49 100644 --- a/debian/mariadb-common.install +++ b/debian/mariadb-common.install @@ -1 +1 @@ -debian/additions/mariadb.cnf etc/mysql/ +debian/additions/mariadb.cnf etc/mariadb/ diff --git a/debian/mariadb-common.links b/debian/mariadb-common.links new file mode 100644 index 0000000000000..4fbee6c45b438 --- /dev/null +++ b/debian/mariadb-common.links @@ -0,0 +1 @@ +etc/mariadb/mariadb.cnf etc/mariadb/my.cnf diff --git a/debian/mariadb-common.lintian-overrides b/debian/mariadb-common.lintian-overrides index 03b98e4330872..0f7bf8f635345 100644 --- a/debian/mariadb-common.lintian-overrides +++ b/debian/mariadb-common.lintian-overrides @@ -1,2 +1,2 @@ # This false-positive as is just seeks dot -synopsis-is-a-sentence "MariaDB database common files (e.g. /etc/mysql/mariadb.conf.d/)" +synopsis-is-a-sentence "MariaDB database common files (e.g. /etc/mariadb/mariadb.conf.d/)" diff --git a/debian/mariadb-common.postinst b/debian/mariadb-common.postinst index 0292a88c6f9c0..118695ab69b80 100644 --- a/debian/mariadb-common.postinst +++ b/debian/mariadb-common.postinst @@ -4,37 +4,13 @@ set -e case "$1" in configure) - # New packaging paradigm for my.cnf handling among MySQL variants - # Used in Ubuntu since Dec-2014 and in Debian since Jul-2015 - # - # If the new mysql-common package does not provide - # the update-alternatives facility, notify user about manual fall back + # Remove my.cnf alternatives pointing to MariaDB. if [ -f /usr/share/mysql-common/configure-symlinks ] then - /usr/share/mysql-common/configure-symlinks install mariadb "/etc/mysql/mariadb.cnf" - else - # As configure can be called many times, don't re-create the symlink - # if it is there already - if [ ! -L /etc/mysql/my.cnf ] - then - echo "Notice: configure-symlinks trigger could not be called." - echo "Please manually create symlinks by running: " - echo " mv -f /etc/mysql/my.cnf /etc/mysql/my.cnf.old" - echo " ln -sf mariadb.cnf /etc/mysql/my.cnf" - fi + /usr/share/mysql-common/configure-symlinks remove mariadb "/etc/mysql/mariadb.cnf" || true fi - # Note that MySQL in Debian runs the configure-symlinks from the - # mysql-server-x.x.postinst and postrm files, while the MySQL.com (and - # Percona.com) packaging triggers update-alternatives directly form the - # mysql-common (and percona-x-common) package using priority 200. - # - # Thus, we need to ensure here that mariadb.cnf indeed became the primary - # alternative and override with priority 500 if needed. - if ! update-alternatives --query my.cnf | grep --quiet "Value: /etc/mysql/mariadb.cnf" - then - update-alternatives --install /etc/mysql/my.cnf my.cnf "/etc/mysql/mariadb.cnf" 500 || true - fi + update-alternatives --remove my.cnf "/etc/mysql/mariadb.cnf" 2>/dev/null || true ;; esac diff --git a/debian/mariadb-common.postrm b/debian/mariadb-common.postrm index d807c63aec96c..4b1b9e445ba67 100644 --- a/debian/mariadb-common.postrm +++ b/debian/mariadb-common.postrm @@ -4,12 +4,16 @@ set -e case "$1" in remove|disappear) - # New packaging paradigm for my.cnf handling among MySQL variants - # Used in Ubuntu since Dec-2014 and in Debian since Jul-2015 + # Withdraw from the /etc/mysql/my.cnf alternatives if still registered from + # previous MySQL variant packaging paradigm. if [ -f /usr/share/mysql-common/configure-symlinks ] then - /usr/share/mysql-common/configure-symlinks remove mariadb "/etc/mysql/mariadb.cnf" + /usr/share/mysql-common/configure-symlinks remove mariadb "/etc/mysql/mariadb.cnf" || true fi + update-alternatives --remove my.cnf "/etc/mysql/mariadb.cnf" 2>/dev/null || true + ;; + purge) + rmdir /etc/mariadb 2>/dev/null || true ;; esac diff --git a/debian/mariadb-common.preinst b/debian/mariadb-common.preinst new file mode 100644 index 0000000000000..40b2499056a00 --- /dev/null +++ b/debian/mariadb-common.preinst @@ -0,0 +1,47 @@ +#!/bin/sh +set -e + +mariadb_cfgdir=/etc/mariadb +legacy_mariadb_cfgdir=/etc/mysql + +# Migrate MariaDB's configuration from /etc/mysql to /etc/mariadb on upgrade. +if [ "$1" = "upgrade" ] && [ -d "$legacy_mariadb_cfgdir" ] +then + mkdir -p "$mariadb_cfgdir" + + # Main config file. + if [ -e "$legacy_mariadb_cfgdir/mariadb.cnf" ] && [ ! -e "$mariadb_cfgdir/mariadb.cnf" ] + then + mv "$legacy_mariadb_cfgdir/mariadb.cnf" "$mariadb_cfgdir/mariadb.cnf" + echo "Moved $legacy_mariadb_cfgdir/mariadb.cnf to $mariadb_cfgdir/mariadb.cnf" + fi + + # MariaDB-specific config directory. + if [ -d "$legacy_mariadb_cfgdir/mariadb.conf.d" ] && [ ! -e "$mariadb_cfgdir/mariadb.conf.d" ] + then + mv "$legacy_mariadb_cfgdir/mariadb.conf.d" "$mariadb_cfgdir/mariadb.conf.d" + echo "Moved $legacy_mariadb_cfgdir/mariadb.conf.d/ to $mariadb_cfgdir/mariadb.conf.d/" + elif [ -d "$legacy_mariadb_cfgdir/mariadb.conf.d" ] + then + # Folder exists, move any missing files over. + for f in "$legacy_mariadb_cfgdir/mariadb.conf.d"/*.cnf + do + [ -e "$f" ] || continue + base=$(basename "$f") + if [ ! -e "$mariadb_cfgdir/mariadb.conf.d/$base" ] + then + mv "$f" "$mariadb_cfgdir/mariadb.conf.d/$base" + echo "Moved $f to $mariadb_cfgdir/mariadb.conf.d/$base" + fi + done + fi + + # debian-start script + if [ -e "$legacy_mariadb_cfgdir/debian-start" ] && [ ! -e "$mariadb_cfgdir/debian-start" ] + then + mv "$legacy_mariadb_cfgdir/debian-start" "$mariadb_cfgdir/debian-start" + echo "Moved $legacy_mariadb_cfgdir/debian-start to $mariadb_cfgdir/debian-start" + fi +fi + +#DEBHELPER# diff --git a/debian/mariadb-plugin-connect.install b/debian/mariadb-plugin-connect.install index e2500269438a8..c8b27d81c086f 100644 --- a/debian/mariadb-plugin-connect.install +++ b/debian/mariadb-plugin-connect.install @@ -1,2 +1,2 @@ -etc/mysql/mariadb.conf.d/connect.cnf +etc/mariadb/mariadb.conf.d/connect.cnf usr/lib/mysql/plugin/ha_connect.so diff --git a/debian/mariadb-plugin-cracklib-password-check.install b/debian/mariadb-plugin-cracklib-password-check.install index 6592c7f461b51..e42d59362e100 100644 --- a/debian/mariadb-plugin-cracklib-password-check.install +++ b/debian/mariadb-plugin-cracklib-password-check.install @@ -1,2 +1,2 @@ -etc/mysql/mariadb.conf.d/cracklib_password_check.cnf +etc/mariadb/mariadb.conf.d/cracklib_password_check.cnf usr/lib/mysql/plugin/cracklib_password_check.so diff --git a/debian/mariadb-plugin-gssapi-server.install b/debian/mariadb-plugin-gssapi-server.install index 8261db789f7f6..5a145bc7a9d85 100644 --- a/debian/mariadb-plugin-gssapi-server.install +++ b/debian/mariadb-plugin-gssapi-server.install @@ -1,2 +1,2 @@ -etc/mysql/mariadb.conf.d/auth_gssapi.cnf +etc/mariadb/mariadb.conf.d/auth_gssapi.cnf usr/lib/mysql/plugin/auth_gssapi.so diff --git a/debian/mariadb-plugin-hashicorp-key-management.install b/debian/mariadb-plugin-hashicorp-key-management.install index ca63f3df403cd..ecc323e2fd717 100644 --- a/debian/mariadb-plugin-hashicorp-key-management.install +++ b/debian/mariadb-plugin-hashicorp-key-management.install @@ -1,3 +1,3 @@ -etc/mysql/mariadb.conf.d/hashicorp_key_management.cnf +etc/mariadb/mariadb.conf.d/hashicorp_key_management.cnf usr/lib/mysql/plugin/hashicorp_key_management.so usr/share/doc/mariadb-plugin-hashicorp-key-management/hashicorp_key_management.txt diff --git a/debian/mariadb-plugin-mroonga.postinst b/debian/mariadb-plugin-mroonga.postinst index 22cae86249f44..544ce35e857ae 100644 --- a/debian/mariadb-plugin-mroonga.postinst +++ b/debian/mariadb-plugin-mroonga.postinst @@ -3,7 +3,7 @@ set -e # Install Mroonga -mariadb --defaults-file=/etc/mysql/debian.cnf < /usr/share/mariadb/mroonga/install.sql || true +mariadb --defaults-file=/etc/mariadb/debian.cnf < /usr/share/mariadb/mroonga/install.sql || true # Always exit with success instead of leaving dpkg in a broken state diff --git a/debian/mariadb-plugin-mroonga.prerm b/debian/mariadb-plugin-mroonga.prerm index 0fde33765e86a..6ad82800a28a7 100644 --- a/debian/mariadb-plugin-mroonga.prerm +++ b/debian/mariadb-plugin-mroonga.prerm @@ -3,7 +3,7 @@ set -e # Uninstall Mroonga -mariadb --defaults-file=/etc/mysql/debian.cnf < /usr/share/mariadb/mroonga/uninstall.sql || true +mariadb --defaults-file=/etc/mariadb/debian.cnf < /usr/share/mariadb/mroonga/uninstall.sql || true # Always exit with success instead of leaving dpkg in a broken state diff --git a/debian/mariadb-plugin-oqgraph.install b/debian/mariadb-plugin-oqgraph.install index 675b73c5d76ed..3f59b8def3591 100644 --- a/debian/mariadb-plugin-oqgraph.install +++ b/debian/mariadb-plugin-oqgraph.install @@ -1,2 +1,2 @@ -etc/mysql/mariadb.conf.d/oqgraph.cnf +etc/mariadb/mariadb.conf.d/oqgraph.cnf usr/lib/mysql/plugin/ha_oqgraph.so diff --git a/debian/mariadb-plugin-provider-bzip2.install b/debian/mariadb-plugin-provider-bzip2.install index 75a73c384a714..e8a6ecc322da8 100644 --- a/debian/mariadb-plugin-provider-bzip2.install +++ b/debian/mariadb-plugin-provider-bzip2.install @@ -1,2 +1,2 @@ -etc/mysql/mariadb.conf.d/provider_bzip2.cnf +etc/mariadb/mariadb.conf.d/provider_bzip2.cnf usr/lib/mysql/plugin/provider_bzip2.so diff --git a/debian/mariadb-plugin-provider-lz4.install b/debian/mariadb-plugin-provider-lz4.install index a3ba1d77bb3e6..52bb863286e32 100644 --- a/debian/mariadb-plugin-provider-lz4.install +++ b/debian/mariadb-plugin-provider-lz4.install @@ -1,2 +1,2 @@ -etc/mysql/mariadb.conf.d/provider_lz4.cnf +etc/mariadb/mariadb.conf.d/provider_lz4.cnf usr/lib/mysql/plugin/provider_lz4.so diff --git a/debian/mariadb-plugin-provider-lzma.install b/debian/mariadb-plugin-provider-lzma.install index 4a4138b45c613..7298cfe0e4eb8 100644 --- a/debian/mariadb-plugin-provider-lzma.install +++ b/debian/mariadb-plugin-provider-lzma.install @@ -1,2 +1,2 @@ -etc/mysql/mariadb.conf.d/provider_lzma.cnf +etc/mariadb/mariadb.conf.d/provider_lzma.cnf usr/lib/mysql/plugin/provider_lzma.so diff --git a/debian/mariadb-plugin-provider-lzo.install b/debian/mariadb-plugin-provider-lzo.install index 2bf4c091ddc62..04013326f5da3 100644 --- a/debian/mariadb-plugin-provider-lzo.install +++ b/debian/mariadb-plugin-provider-lzo.install @@ -1,2 +1,2 @@ -etc/mysql/mariadb.conf.d/provider_lzo.cnf +etc/mariadb/mariadb.conf.d/provider_lzo.cnf usr/lib/mysql/plugin/provider_lzo.so diff --git a/debian/mariadb-plugin-provider-snappy.install b/debian/mariadb-plugin-provider-snappy.install index 26c929c89bad4..b9b02d138f441 100644 --- a/debian/mariadb-plugin-provider-snappy.install +++ b/debian/mariadb-plugin-provider-snappy.install @@ -1,2 +1,2 @@ -etc/mysql/mariadb.conf.d/provider_snappy.cnf +etc/mariadb/mariadb.conf.d/provider_snappy.cnf usr/lib/mysql/plugin/provider_snappy.so diff --git a/debian/mariadb-plugin-rocksdb.install b/debian/mariadb-plugin-rocksdb.install index 67b8026d697b0..5b76cd2a3baa0 100644 --- a/debian/mariadb-plugin-rocksdb.install +++ b/debian/mariadb-plugin-rocksdb.install @@ -1,4 +1,4 @@ -etc/mysql/mariadb.conf.d/rocksdb.cnf +etc/mariadb/mariadb.conf.d/rocksdb.cnf usr/bin/mariadb-ldb usr/bin/myrocks_hotbackup usr/bin/mysql_ldb diff --git a/debian/mariadb-plugin-s3.install b/debian/mariadb-plugin-s3.install index b951e49dd0b55..5d4c230bc83cd 100644 --- a/debian/mariadb-plugin-s3.install +++ b/debian/mariadb-plugin-s3.install @@ -1,4 +1,4 @@ -etc/mysql/mariadb.conf.d/s3.cnf +etc/mariadb/mariadb.conf.d/s3.cnf usr/bin/aria_s3_copy usr/lib/mysql/plugin/ha_s3.so usr/share/man/man1/aria_s3_copy.1 diff --git a/debian/mariadb-plugin-spider.install b/debian/mariadb-plugin-spider.install index 1ad1361b00e88..b321224a25891 100644 --- a/debian/mariadb-plugin-spider.install +++ b/debian/mariadb-plugin-spider.install @@ -1,2 +1,2 @@ -etc/mysql/mariadb.conf.d/spider.cnf +etc/mariadb/mariadb.conf.d/spider.cnf usr/lib/mysql/plugin/ha_spider.so diff --git a/debian/mariadb-plugin-videx.install b/debian/mariadb-plugin-videx.install index 8c8a327fe7afc..4aed0b063d35b 100644 --- a/debian/mariadb-plugin-videx.install +++ b/debian/mariadb-plugin-videx.install @@ -1,2 +1,2 @@ -etc/mysql/mariadb.conf.d/videx.cnf -usr/lib/mysql/plugin/ha_videx.so \ No newline at end of file +etc/mariadb/mariadb.conf.d/videx.cnf +usr/lib/mysql/plugin/ha_videx.so diff --git a/debian/mariadb-server-galera.install b/debian/mariadb-server-galera.install index 8b76b5af8211c..078eabbde5e27 100644 --- a/debian/mariadb-server-galera.install +++ b/debian/mariadb-server-galera.install @@ -1,5 +1,5 @@ -etc/mysql/mariadb.conf.d/wsrep_info.cnf -debian/additions/mariadb.conf.d/60-galera.cnf etc/mysql/mariadb.conf.d +etc/mariadb/mariadb.conf.d/wsrep_info.cnf +debian/additions/mariadb.conf.d/60-galera.cnf etc/mariadb/mariadb.conf.d usr/bin/galera_new_cluster usr/bin/galera_recovery usr/bin/wsrep_sst_common diff --git a/debian/mariadb-server.README.Debian b/debian/mariadb-server.README.Debian index 708453448913f..c49664cb8550a 100644 --- a/debian/mariadb-server.README.Debian +++ b/debian/mariadb-server.README.Debian @@ -4,7 +4,7 @@ The most common reasons the server does not start are: - AppArmor is enforced and something is wrong with the confinement profile. - Process supervisor scripts (init, systemd etc) fail to execute normally. -- The configuration in /etc/mysql/... is wrong and prevents server from running. +- The configuration in /etc/mariadb/... is wrong and prevents server from running. First check the contents of syslog (or systemd journal) and then check the logs at /var/log/mysql/ for any hints of what might be wrong. @@ -64,11 +64,11 @@ You may never ever delete the MariaDB user "root". Although it has no password is set, the unix_auth plugin ensure that it can only be run locally as the root user. -The credentials in /etc/mysql/debian.cnf specify the user which is used by the +The credentials in /etc/mariadb/debian.cnf specify the user which is used by the init scripts to stop the server and perform log rotation. This used to be the debian-sys-maint user which is no longer used as root can run directly. -If you have start/stop problems make sure that the /etc/mysql/debian.cnf file +If you have start/stop problems make sure that the /etc/mariadb/debian.cnf file specifies the root user and no password. In the long run please stop using that file as is has been obsoleted. @@ -79,8 +79,8 @@ file as is has been obsoleted. MariaDB in Debian is secure by default, because: - It only listens to the localhost socket and cannot be accessed remotely unless - the sysadmin changes the configuration in /etc/mysql to allow so. -- There is no debian-sys-maint with password in /etc/mysql/debian.cnf anymore. + the sysadmin changes the configuration in /etc/mariadb to allow so. +- There is no debian-sys-maint with password in /etc/mariadb/debian.cnf anymore. - There is no root account with password anymore. The system admin needs to create one themselves if they need it. With no password, all issues related to password management and password leaking are gone. Sysadmins can access @@ -125,7 +125,7 @@ The only thing that is left over for the admin is ============ For security reasons, the Debian package has enabled networking only on the -loop-back device using "bind-address" in /etc/mysql/mariadb.cnf. Check with +loop-back device using "bind-address" in /etc/mariadb/mariadb.cnf. Check with "netstat -tlnp" where it is listening. If your connection is aborted immediately check your firewall rules or network routes. diff --git a/debian/mariadb-server.install b/debian/mariadb-server.install index 8686b0cb95315..6c4d51174a529 100644 --- a/debian/mariadb-server.install +++ b/debian/mariadb-server.install @@ -1,12 +1,12 @@ -debian/additions/debian-start etc/mysql +debian/additions/debian-start etc/mariadb debian/additions/debian-start.inc.sh usr/share/mariadb debian/additions/echo_stderr usr/share/mariadb -debian/additions/mariadb.conf.d/50-server.cnf etc/mysql/mariadb.conf.d +debian/additions/mariadb.conf.d/50-server.cnf etc/mariadb/mariadb.conf.d debian/additions/source_mariadb.py usr/share/apport/package-hooks etc/apparmor.d/usr.sbin.mariadbd etc/logrotate.d/mariadb etc/security/user_map.conf -support-files/rpm/enable_encryption.preset etc/mysql/mariadb.conf.d/99-enable-encryption.cnf.preset +support-files/rpm/enable_encryption.preset etc/mariadb/mariadb.conf.d/99-enable-encryption.cnf.preset usr/bin/aria_chk usr/bin/aria_dump_log usr/bin/aria_ftdump diff --git a/debian/mariadb-server.logcheck.ignore.paranoid b/debian/mariadb-server.logcheck.ignore.paranoid index 407d40632701c..01c64357bcbab 100644 --- a/debian/mariadb-server.logcheck.ignore.paranoid +++ b/debian/mariadb-server.logcheck.ignore.paranoid @@ -1,6 +1,6 @@ /etc/init.d/mariadb\[[0-9]+\]: Check that mariadbd is running and that the socket: '/run/mysqld/mysqld.sock' exists\!$ -/etc/init.d/mariadb\[[0-9]+\]: '/usr/bin/mysqladmin --defaults-(extra-)?file=/etc/mysql/debian.cnf ping' resulted in$ -/etc/mysql/debian-start\[[0-9]+\]: Checking for crashed MySQL tables\.$ +/etc/init.d/mariadb\[[0-9]+\]: '/usr/bin/mysqladmin --defaults-(extra-)?file=/etc/mariadb/debian.cnf ping' resulted in$ +/etc/mariadb/debian-start\[[0-9]+\]: Checking for crashed MySQL tables\.$ mariadbd\[[0-9]+\]: $ mariadbd\[[0-9]+\]: Version: .* socket: '/run/mysqld/mysqld.sock' port: 3306$ mariadbd\[[0-9]+\]: Warning: Ignoring user change to 'mysql' because the user was set to 'mysql' earlier on the command line$ diff --git a/debian/mariadb-server.logcheck.ignore.server b/debian/mariadb-server.logcheck.ignore.server index 7db321a02d40c..524f2dbbcfcd7 100644 --- a/debian/mariadb-server.logcheck.ignore.server +++ b/debian/mariadb-server.logcheck.ignore.server @@ -1,7 +1,7 @@ -/etc/init.d/mariadb\[[0-9]+\]: [0-9]+ processes alive and '/usr/bin/mysqladmin --defaults-(extra-)?file=/etc/mysql/debian.cnf ping' resulted in$ +/etc/init.d/mariadb\[[0-9]+\]: [0-9]+ processes alive and '/usr/bin/mysqladmin --defaults-(extra-)?file=/etc/mariadb/debian.cnf ping' resulted in$ /etc/init.d/mariadb\[[0-9]+\]: Check that mariadbd is running and that the socket: '/run/mysqld/mysqld.sock' exists\!$ -/etc/init.d/mariadb\[[0-9]+\]: '/usr/bin/mysqladmin --defaults-(extra-)?file=/etc/mysql/debian.cnf ping' resulted in$ -/etc/mysql/debian-start\[[0-9]+\]: Checking for crashed MySQL tables\.$ +/etc/init.d/mariadb\[[0-9]+\]: '/usr/bin/mysqladmin --defaults-(extra-)?file=/etc/mariadb/debian.cnf ping' resulted in$ +/etc/mariadb/debian-start\[[0-9]+\]: Checking for crashed MySQL tables\.$ mariadbd\[[0-9]+\]: ?$ mariadbd\[[0-9]+\]: .*InnoDB: Shutdown completed mariadbd\[[0-9]+\]: .*InnoDB: Started; diff --git a/debian/mariadb-server.logcheck.ignore.workstation b/debian/mariadb-server.logcheck.ignore.workstation index 7db321a02d40c..524f2dbbcfcd7 100644 --- a/debian/mariadb-server.logcheck.ignore.workstation +++ b/debian/mariadb-server.logcheck.ignore.workstation @@ -1,7 +1,7 @@ -/etc/init.d/mariadb\[[0-9]+\]: [0-9]+ processes alive and '/usr/bin/mysqladmin --defaults-(extra-)?file=/etc/mysql/debian.cnf ping' resulted in$ +/etc/init.d/mariadb\[[0-9]+\]: [0-9]+ processes alive and '/usr/bin/mysqladmin --defaults-(extra-)?file=/etc/mariadb/debian.cnf ping' resulted in$ /etc/init.d/mariadb\[[0-9]+\]: Check that mariadbd is running and that the socket: '/run/mysqld/mysqld.sock' exists\!$ -/etc/init.d/mariadb\[[0-9]+\]: '/usr/bin/mysqladmin --defaults-(extra-)?file=/etc/mysql/debian.cnf ping' resulted in$ -/etc/mysql/debian-start\[[0-9]+\]: Checking for crashed MySQL tables\.$ +/etc/init.d/mariadb\[[0-9]+\]: '/usr/bin/mysqladmin --defaults-(extra-)?file=/etc/mariadb/debian.cnf ping' resulted in$ +/etc/mariadb/debian-start\[[0-9]+\]: Checking for crashed MySQL tables\.$ mariadbd\[[0-9]+\]: ?$ mariadbd\[[0-9]+\]: .*InnoDB: Shutdown completed mariadbd\[[0-9]+\]: .*InnoDB: Started; diff --git a/debian/mariadb-server.mariadb.init b/debian/mariadb-server.mariadb.init index 765640327d19d..26552a682766c 100644 --- a/debian/mariadb-server.mariadb.init +++ b/debian/mariadb-server.mariadb.init @@ -26,10 +26,10 @@ SELF="$(cd "$(dirname "$0")"; pwd -P)/$(basename "$0")" if [ -f /usr/bin/mariadb-admin ] then - MYADMIN="/usr/bin/mariadb-admin --defaults-file=/etc/mysql/debian.cnf" + MYADMIN="/usr/bin/mariadb-admin --defaults-file=/etc/mariadb/debian.cnf" elif [ -f /usr/bin/mysqladmin ] then - MYADMIN="/usr/bin/mysqladmin --defaults-file=/etc/mysql/debian.cnf" + MYADMIN="/usr/bin/mysqladmin --defaults-file=/etc/mariadb/debian.cnf" else log_failure_msg "Command mariadb-admin/mysqladmin not found! This SysV init script depends on it." exit 1 @@ -66,7 +66,7 @@ umask 077 # mysqladmin likes to read /root/.my.cnf. This is usually not what I want # as many admins e.g. only store a password without a username there and # so break my scripts. -export HOME=/etc/mysql/ +export HOME=/etc/mariadb/ ## Fetch a particular option from mysql's invocation. # @@ -82,10 +82,10 @@ mariadbd_get_param() { ## Do some sanity checks before even trying to start mariadbd. sanity_checks() { # check for config file - if [ ! -r /etc/mysql/my.cnf ] + if [ ! -r /etc/mariadb/my.cnf ] then - log_warning_msg "$0: WARNING: /etc/mysql/my.cnf cannot be read. See README.Debian.gz" - echo "WARNING: /etc/mysql/my.cnf cannot be read. See README.Debian.gz" | $ERR_LOGGER + log_warning_msg "$0: WARNING: /etc/mariadb/my.cnf cannot be read. See README.Debian.gz" + echo "WARNING: /etc/mariadb/my.cnf cannot be read. See README.Debian.gz" | $ERR_LOGGER fi # check for diskspace shortage @@ -199,7 +199,7 @@ case "${1:-''}" in then log_end_msg 0 # Now start mysqlcheck or whatever the admin wants. - output=$(/etc/mysql/debian-start) + output=$(/etc/mariadb/debian-start) if [ -n "$output" ] then log_action_msg "$output" diff --git a/debian/mariadb-server.mysql.default b/debian/mariadb-server.mysql.default index a4d24fe9a4169..6f63685caa275 100644 --- a/debian/mariadb-server.mysql.default +++ b/debian/mariadb-server.mysql.default @@ -12,11 +12,11 @@ # # Note also that MariaDB systemd does _not_ utilize mysqld_safe. -# The delay in seconds the init script waits for the server to be up and running after having started "mysqld_safe" to run the "/etc/mysql/debian-start" script. +# The delay in seconds the init script waits for the server to be up and running after having started "mysqld_safe" to run the "/etc/mariadb/debian-start" script. # If the server is still not responding after the delay, the script won't be executed and an error will be thrown on the syslog. # Default: 30 #MYSQLD_STARTUP_TIMEOUT=30 -# The email recipient(s) of the output of the check for crashed and improperly closed MyISAM and Aria tables done at each server start by the "/etc/mysql/debian-start" script. +# The email recipient(s) of the output of the check for crashed and improperly closed MyISAM and Aria tables done at each server start by the "/etc/mariadb/debian-start" script. # Default: root #MYCHECK_RCPT="root" diff --git a/debian/mariadb-server.postinst b/debian/mariadb-server.postinst index 3d7ff59bb4a1e..a9052ada7a963 100644 --- a/debian/mariadb-server.postinst +++ b/debian/mariadb-server.postinst @@ -63,7 +63,7 @@ case "$1" in mariadb_statedir=/usr/share/mariadb mariadb_datadir=/var/lib/mysql mariadb_logdir=/var/log/mysql - mariadb_cfgdir=/etc/mysql + mariadb_cfgdir=/etc/mariadb mariadb_upgradedir=/var/lib/mysql-upgrade # If the following symlink exists, it is a preserved copy the old data dir @@ -190,7 +190,7 @@ EOF # initiate databases. Output is not allowed by debconf :-( # This will fail if we are upgrading an existing database; in this case - # mariadb-upgrade, called from the /etc/mysql/debian-start script, will + # mariadb-upgrade, called from the /etc/mariadb/debian-start script, will # handle things. # Debian: beware of the bashisms... # Debian: can safely run on upgrades with existing databases @@ -206,11 +206,11 @@ EOF # On new installations root user can connect via unix_socket. # But on upgrades, scripts rely on debian-sys-maint user and - # credentials in /etc/mysql/debian.cnf - # All tools use --defaults-file=/etc/mysql/debian.cnf + # credentials in /etc/mariadb/debian.cnf + # All tools use --defaults-file=/etc/mariadb/debian.cnf # And while it's not needed for new installations, we keep using # --defaults-file option for tools (for the sake of upgrades) - # and thus need /etc/mysql/debian.cnf to exist, even if it's empty. + # and thus need /etc/mariadb/debian.cnf to exist, even if it's empty. # In the long run the goal is to obsolete this file. dc="$mariadb_cfgdir/debian.cnf" if [ ! -d "$mariadb_cfgdir" ] @@ -218,13 +218,20 @@ EOF install -o 0 -g 0 -m 0755 -d $mariadb_cfgdir fi + # Migrate the file from its pre-/etc/mariadb location on upgrade. + if [ ! -e "$dc" ] && [ -e /etc/mysql/debian.cnf ] + then + mv /etc/mysql/debian.cnf "$dc" + echo "Moved /etc/mysql/debian.cnf to $dc" + fi + if [ ! -e "$dc" ] then cat /dev/null > $dc { echo "# THIS FILE IS OBSOLETE. STOP USING IT IF POSSIBLE."; echo "# This file exists only for backwards compatibility for"; - echo "# tools that run '--defaults-file=/etc/mysql/debian.cnf'"; + echo "# tools that run '--defaults-file=/etc/mariadb/debian.cnf'"; echo "# and have root level access to the local filesystem."; echo "# With those permissions one can run 'mariadb' directly"; echo "# anyway thanks to unix socket authentication and hence"; diff --git a/debian/mariadb-server.postrm b/debian/mariadb-server.postrm index 601fe87f7e9ad..5c1f857dca7ed 100644 --- a/debian/mariadb-server.postrm +++ b/debian/mariadb-server.postrm @@ -30,7 +30,7 @@ then then # never remove the debian.cnf when the databases are still existing # else we ran into big trouble on the next install! - rm -f /etc/mysql/debian.cnf + rm -f /etc/mariadb/debian.cnf # Remove all contents from /var/lib/mysql except if it's a # directory with file system data. See #829491 for details and # #608938 for potential mysql-server leftovers which erroneously diff --git a/debian/mariadb-server.preinst b/debian/mariadb-server.preinst index 74503f227ffa2..5f2b1b9233aa6 100644 --- a/debian/mariadb-server.preinst +++ b/debian/mariadb-server.preinst @@ -169,7 +169,7 @@ then mv -f "$mariadb_datadir" "$mariadb_datadir-$found_version" # Also move away the old debian.cnf file that included credentials that are # no longer valid. If none existed, ignore error and let dpkg continue. - mv -f /etc/mysql/debian.cnf "/etc/mysql/debian.cnf-$found_version" || true + mv -f /etc/mariadb/debian.cnf "/etc/mariadb/debian.cnf-$found_version" 2>/dev/null || true fi # to be sure diff --git a/debian/mariadb-server.triggers b/debian/mariadb-server.triggers index 8f6d2f8f32ec0..51951f201d4a6 100644 --- a/debian/mariadb-server.triggers +++ b/debian/mariadb-server.triggers @@ -1,3 +1,4 @@ +interest-noawait /etc/mariadb interest-noawait /etc/mysql interest-noawait /etc/systemd/system/mariadb.service.d interest-noawait /lib/systemd/system/mariadb.service.d diff --git a/debian/mysql-common.dirs b/debian/mysql-common.dirs deleted file mode 100644 index a5a88ede9c12e..0000000000000 --- a/debian/mysql-common.dirs +++ /dev/null @@ -1 +0,0 @@ -etc/mysql/conf.d/ diff --git a/debian/mysql-common.links b/debian/mysql-common.links deleted file mode 100644 index 5c45a67e4fc10..0000000000000 --- a/debian/mysql-common.links +++ /dev/null @@ -1 +0,0 @@ -etc/mysql/mariadb.cnf etc/mysql/my.cnf diff --git a/debian/mysql-common.lintian-overrides b/debian/mysql-common.lintian-overrides deleted file mode 100644 index 429aaa9898c0a..0000000000000 --- a/debian/mysql-common.lintian-overrides +++ /dev/null @@ -1,2 +0,0 @@ -# This false-positive as is just seeks dot -synopsis-is-a-sentence "MariaDB client common configuration files package (e.g. /etc/mysql/my.cnf)" diff --git a/debian/mysql-common.postrm b/debian/mysql-common.postrm deleted file mode 100644 index 4418e5fa30433..0000000000000 --- a/debian/mysql-common.postrm +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash -set -e - -if [ "$1" = "purge" ]; then - rmdir /etc/mysql 2>/dev/null || true -fi - -#DEBHELPER# diff --git a/debian/not-installed b/debian/not-installed index dc34286f7f2f5..e2dd1609fef2b 100644 --- a/debian/not-installed +++ b/debian/not-installed @@ -1,9 +1,9 @@ etc/columnstore/storagemanager.cnf.example # Copy of etc/columnstore/storagemanager.cnf that is installed -etc/my.cnf # Debian packaging has /etc/mysql/my.cnf, which is a symlink to mariadb.cnf -etc/mysql/mariadb.conf.d/client.cnf # Debian packaging uses files from debian/additions/mariadb.cnf.d/ -etc/mysql/mariadb.conf.d/enable_encryption.preset # Debian packaging uses files from debian/additions/mariadb.cnf.d/ -etc/mysql/mariadb.conf.d/mysql-clients.cnf # Debian packaging uses files from debian/additions/mariadb.cnf.d/ -etc/mysql/mariadb.conf.d/server.cnf # Debian packaging uses files from debian/additions/mariadb.cnf.d/ +etc/my.cnf # Debian packaging has /etc/mariadb/my.cnf, which is a symlink to mariadb.cnf +etc/mariadb/mariadb.conf.d/client.cnf # Debian packaging uses files from debian/additions/mariadb.cnf.d/ +etc/mariadb/mariadb.conf.d/enable_encryption.preset # Debian packaging uses files from debian/additions/mariadb.cnf.d/ +etc/mariadb/mariadb.conf.d/mysql-clients.cnf # Debian packaging uses files from debian/additions/mariadb.cnf.d/ +etc/mariadb/mariadb.conf.d/server.cnf # Debian packaging uses files from debian/additions/mariadb.cnf.d/ usr/lib/systemd/system/mariadb-extra.socket # Installed by rules file usr/lib/systemd/system/mariadb.socket # Installed by rules file usr/bin/mariadb-embedded # Shipping the embedded server in distro packaging does not make sense diff --git a/debian/salsa-ci.yml b/debian/salsa-ci.yml index ba0355f84e2f6..6482ad31bc65b 100644 --- a/debian/salsa-ci.yml +++ b/debian/salsa-ci.yml @@ -204,7 +204,7 @@ blhc: dpkg -l | grep -e "mariadb-server.*10\.11" mkdir -p debug # Ensure dir exists before using it find /var/lib/mysql -ls > debug/var-lib-mysql.list || true # Ignore errors about "no such file or directory" - cp -ra /etc/mysql debug/etc-mysql + cp -ra /etc/mariadb debug/etc-mariadb mariadb --skip-column-names -e "select @@version, @@version_comment" # Show version mariadb --table -e "SHOW DATABASES;" # List databases mariadb --table -e "SELECT host,user,plugin,authentication_string FROM user;" mysql @@ -593,7 +593,7 @@ test basic features: openssl verify -CAfile $CERT_PATH/cacert.pem $CERT_PATH/server-cert.pem openssl x509 -subject -issuer -noout -in $CERT_PATH/cacert.pem openssl x509 -subject -issuer -noout -in $CERT_PATH/server-cert.pem - cat < /etc/mysql/mariadb.conf.d/tls.cnf + cat < /etc/mariadb/mariadb.conf.d/tls.cnf [client-server] ssl = on ssl-ca = $CERT_PATH/cacert.pem @@ -757,8 +757,8 @@ mysql-8.0 in Ubuntu 23.10 upgrade: - apt-get install -qq --yes mariadb-server # Due to usrmerge, full-upgrade from Mantic to Trixie or newer may not work - service mariadb status # There is no init.d/mysql in MariaDB 10.5+ - # Remove everything MySQL except mysql-common which also MariaDB depends on - - apt-get purge --yes mysql-s* mysql-cl* libmysql* + # Remove everything MySQL + - apt-get purge --yes mysql-* libmysql* - *test-verify-final # Upgrading from MySQL 8.0 with datadir in place is not possible. Users need to do a data dump. @@ -943,12 +943,12 @@ mariadb.org-10.2 upgrade: # Verify initial state before upgrade - dpkg -l | grep -iE 'maria|mysql|galera' || true # List installed - service mysql status - # prepending with --defaults-file=/etc/mysql/debian.cnf is needed in upstream 5.5–10.3 + # prepending with --defaults-file=/etc/mariadb/debian.cnf is needed in upstream 5.5–10.3 - | - mysql --defaults-file=/etc/mysql/debian.cnf --skip-column-names -e "SELECT @@version, @@version_comment" - mysql --defaults-file=/etc/mysql/debian.cnf --table -e "SHOW DATABASES;" - mysql --defaults-file=/etc/mysql/debian.cnf --table -e "SELECT * FROM mysql.user; SHOW CREATE USER root@localhost;" - mysql --defaults-file=/etc/mysql/debian.cnf --table -e "SELECT * FROM mysql.plugin; SHOW PLUGINS;" + mysql --defaults-file=/etc/mariadb/debian.cnf --skip-column-names -e "SELECT @@version, @@version_comment" + mysql --defaults-file=/etc/mariadb/debian.cnf --table -e "SHOW DATABASES;" + mysql --defaults-file=/etc/mariadb/debian.cnf --table -e "SELECT * FROM mysql.user; SHOW CREATE USER root@localhost;" + mysql --defaults-file=/etc/mariadb/debian.cnf --table -e "SELECT * FROM mysql.plugin; SHOW PLUGINS;" - *test-install-all # mariadb-10.2 in ships a /etc/init.d/mysql and it continues to exist # after upgrade, and is removed only on purge diff --git a/man/aria_chk.1 b/man/aria_chk.1 index e9e09fd15b345..186b8370f06b3 100644 --- a/man/aria_chk.1 +++ b/man/aria_chk.1 @@ -220,7 +220,7 @@ Internal buffer for sorting keys; Don't touch. Write buffer size for sequential writes during repair .PP Default options are read from the following files in the given order: -\fB/etc/my.cnf /etc/mysql/my.cnf ~/.my.cnf\fR +\fB/etc/my.cnf /etc/mariadb/my.cnf ~/.my.cnf\fR .PP The following groups are read: \fBaria_chk\fR .PP diff --git a/man/aria_dump_log.1 b/man/aria_dump_log.1 index 86cec5a33b956..f3663d770657f 100644 --- a/man/aria_dump_log.1 +++ b/man/aria_dump_log.1 @@ -30,7 +30,7 @@ Print version and exit. .PP Default options are read from the following files in the given order: \fB/etc/my.cnf\fB -\fB/etc/mysql/my.cnf\fB +\fB/etc/mariadb/my.cnf\fB \fB~/.my.cnf\fB .PP The following groups are read: \fBaria_dump_log\fR diff --git a/man/aria_pack.1 b/man/aria_pack.1 index 0cd34e6756ffc..a8c544d8b22cb 100644 --- a/man/aria_pack.1 +++ b/man/aria_pack.1 @@ -51,7 +51,7 @@ Output version information and exit. Wait and retry if table is in use. .PP Default options are read from the following files in the given order: -\fB/etc/my.cnf /etc/mysql/my.cnf ~/.my.cnf\fR +\fB/etc/my.cnf /etc/mariadb/my.cnf ~/.my.cnf\fR .PP The following groups are read: \fBariapack\fR .PP diff --git a/man/aria_read_log.1 b/man/aria_read_log.1 index 355573927a826..0eb1e41832c96 100644 --- a/man/aria_read_log.1 +++ b/man/aria_read_log.1 @@ -83,7 +83,7 @@ Print more information during apply/undo phase Print version and exit. .PP Default options are read from the following files in the given order: -\fB/etc/my.cnf /etc/mysql/my.cnf ~/.my.cnf\fR +\fB/etc/my.cnf /etc/mariadb/my.cnf ~/.my.cnf\fR .PP The following groups are read: \fBaria_read_log\fR .PP diff --git a/mysql-test/main/mysqld--defaults-file.test b/mysql-test/main/mysqld--defaults-file.test index 9ca427568ef59..3aa6f66ec0ea7 100644 --- a/mysql-test/main/mysqld--defaults-file.test +++ b/mysql-test/main/mysqld--defaults-file.test @@ -42,8 +42,8 @@ exec $MYSQLD --defaults-file=no_extension --print-defaults 2>&1; exec $MYSQLD --defaults-file=$MYSQLTEST_VARDIR/my.cnf --help --verbose | grep -A 1 'Default options are read'; --echo # Test on `defaults-extra-file` -# = `/etc/my.cnf /etc/mysql/my.cnf` -# Using sysconfdir configuration, we don't always have `/etc/mysql/my.cnf`, so replace them with a regex as well. +# = `/etc/my.cnf /etc/mariadb/my.cnf` +# Using sysconfdir configuration, we don't always have `/etc/mariadb/my.cnf`, so replace them with a regex as well. copy_file $MYSQLTEST_VARDIR/my.cnf $MYSQLTEST_VARDIR/my_test.cnf; --replace_regex /.*my_test.cnf/ MYSQLTEST_VARDIR\/my_test.cnf/ exec $MYSQLD --defaults-extra-file=$MYSQLTEST_VARDIR/my_test.cnf --help --verbose | grep -A 1 'Default options are read'; diff --git a/mysys/my_default.c b/mysys/my_default.c index 7c049c1e789b6..ccd05ea6aac90 100644 --- a/mysys/my_default.c +++ b/mysys/my_default.c @@ -104,7 +104,7 @@ static int search_default_file_with_ext(struct handle_option_ctx *, - Windows: C:/ - Windows: Directory above where the executable is located - Unix: /etc/ or the value of DEFAULT_SYSCONFDIR, if defined - - Unix: /etc/mysql/ unless DEFAULT_SYSCONFDIR is defined + - Unix: /etc/mariadb/ unless DEFAULT_SYSCONFDIR is defined - ALL: getenv("MYSQL_HOME") - ALL: --defaults-extra-file= (run-time option) - Unix: ~/ @@ -1080,7 +1080,7 @@ static const char **init_default_directories(MEM_ROOT *alloc) errors += add_directory(alloc, DEFAULT_SYSCONFDIR, dirs); #else errors += add_directory(alloc, "/etc/", dirs); - errors += add_directory(alloc, "/etc/mysql/", dirs); + errors += add_directory(alloc, "/etc/mariadb/", dirs); #endif /* DEFAULT_SYSCONFDIR */ #endif diff --git a/scripts/mysqld_multi.sh b/scripts/mysqld_multi.sh index 316cc59536de5..c78728af62f48 100644 --- a/scripts/mysqld_multi.sh +++ b/scripts/mysqld_multi.sh @@ -605,7 +605,7 @@ sub list_defaults_files if ('@sysconfdir@') { push @dirs, '@sysconfdir@/my.cnf'; } else { - push @dirs, '/etc/my.cnf', '/etc/mysql/my.cnf'; + push @dirs, '/etc/my.cnf', '/etc/mariadb/my.cnf'; } push @dirs, "$ENV{MYSQL_HOME}/my.cnf" if $ENV{MYSQL_HOME}; push @dirs, $opt{'extra-file'} if $opt{'extra-file'}; diff --git a/support-files/mariadb.logrotate.sh b/support-files/mariadb.logrotate.sh index 68e16a224c600..6b22b010bba3a 100644 --- a/support-files/mariadb.logrotate.sh +++ b/support-files/mariadb.logrotate.sh @@ -45,9 +45,9 @@ # has thanks to the default use of Unix socket authentication for the 'mysql' # (or root on Debian) account used everywhere since MariaDB 10.4. postrotate - if test -r /etc/mysql/debian.cnf + if test -r /etc/mariadb/debian.cnf then - EXTRAPARAM='--defaults-file=/etc/mysql/debian.cnf' + EXTRAPARAM='--defaults-file=/etc/mariadb/debian.cnf' fi if test -x @bindir@/mariadb-admin diff --git a/support-files/policy/apparmor/usr.sbin.mysqld b/support-files/policy/apparmor/usr.sbin.mysqld index c144fb2e777a6..1573c61f925ec 100644 --- a/support-files/policy/apparmor/usr.sbin.mysqld +++ b/support-files/policy/apparmor/usr.sbin.mysqld @@ -37,6 +37,12 @@ /etc/mysql/conf.d/* r, /etc/mysql/mariadb.conf.d/ r, /etc/mysql/mariadb.conf.d/* r, + /etc/mariadb/*.cnf r, + /etc/mariadb/*.pem r, + /etc/mariadb/conf.d/ r, + /etc/mariadb/conf.d/* r, + /etc/mariadb/mariadb.conf.d/ r, + /etc/mariadb/mariadb.conf.d/* r, /etc/nsswitch.conf r, /etc/passwd r, /etc/services r, @@ -126,6 +132,9 @@ /etc/mysql/*.cnf r, /etc/mysql/conf.d/ r, /etc/mysql/conf.d/* r, + /etc/mariadb/*.cnf r, + /etc/mariadb/conf.d/ r, + /etc/mariadb/conf.d/* r, /proc/*/attr/current r, /proc/*/fdinfo/* r, /proc/*/net/* r,