extra/mariadb to 10.4.6-1

This commit is contained in:
Kevin Mihelich 2019-06-27 22:48:06 +00:00
parent a77674fae5
commit 3cfcc0f545
8 changed files with 96 additions and 146 deletions

View file

@ -66,37 +66,6 @@ index 83d75f80b87..d1d24d685f9 100644
# Flush caches. previously [mysqld_safe] flush-caches=1
# ExecStartPre=sync
From 72b42fb1a344bfc3f3c3c905fe85c93ac4a752e3 Mon Sep 17 00:00:00 2001
From: Christian Hesse <mail@eworm.de>
Date: Tue, 29 Jan 2019 23:14:23 +0100
Subject: fix path to our config
---
support-files/rpm/enable_encryption.preset | 2 +-
support-files/rpm/my.cnf | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/support-files/rpm/enable_encryption.preset b/support-files/rpm/enable_encryption.preset
index 722db7e5fa1..978a7494c6b 100644
--- a/support-files/rpm/enable_encryption.preset
+++ b/support-files/rpm/enable_encryption.preset
@@ -1,5 +1,5 @@
#
-# !include this file into your my.cnf (or any of *.cnf files in /etc/my.cnf.d)
+# !include this file into your my.cnf (or any of *.cnf files in /etc/mysql/my.cnf.d)
# and it will enable data at rest encryption. This is a simple way to
# ensure that everything that can be encrypted will be and your
# data will not leak unencrypted.
diff --git a/support-files/rpm/my.cnf b/support-files/rpm/my.cnf
index 913b88f8328..17d25361178 100644
--- a/support-files/rpm/my.cnf
+++ b/support-files/rpm/my.cnf
@@ -7,5 +7,5 @@
#
# include all files from the config directory
#
-!includedir /etc/my.cnf.d
+!includedir /etc/mysql/my.cnf.d
From 820b47c1e70d36f1272cca3ddbdf4bbd2dd62bde Mon Sep 17 00:00:00 2001
From: Christian Hesse <mail@eworm.de>
Date: Wed, 30 Jan 2019 00:46:47 +0100
@ -118,17 +87,4 @@ index 8d43b6db428..d7fa6bf5b14 100644
-Alias=mysqld.service
[Service]
diff --git a/support-files/mariadb@.service.in b/support-files/mariadb@.service.in
index a2f5cff0828..3fc41358e14 100644
--- a/support-files/mariadb@.service.in
+++ b/support-files/mariadb@.service.in
@@ -27,8 +27,6 @@ ConditionPathExists=@sysconf2dir@/my%I.cnf
[Install]
WantedBy=multi-user.target
-Alias=mysql.service
-Alias=mysqld.service
[Service]

View file

@ -1,7 +1,8 @@
From dc7aff5e5331820205282576f6ade015f672969b Mon Sep 17 00:00:00 2001
From aef4f58adf90e9fee4348c1cf6484faeae159255 Mon Sep 17 00:00:00 2001
From: Christian Hesse <mail@eworm.de>
Date: Tue, 2 Jan 2018 14:32:21 +0100
Subject: Use descriptive file names for sysusers and tmpfiles configuration
Subject: [PATCH 1/2] Use descriptive file names for sysusers and tmpfiles
configuration
These files were installed to:
@ -9,15 +10,17 @@ ${INSTALL_SYSTEMD_SYSUSERSDIR}/sysusers.conf
${INSTALL_SYSTEMD_TMPFILESDIR}/tmpfiles.conf
Instead rename the files to more descriptive file names 'mariadb.conf'.
Signed-off-by: Christian Hesse <mail@eworm.de>
---
support-files/CMakeLists.txt | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/support-files/CMakeLists.txt b/support-files/CMakeLists.txt
index 4ad3810e082..8363922d468 100644
index 3655c87b94e..63443245e6e 100644
--- a/support-files/CMakeLists.txt
+++ b/support-files/CMakeLists.txt
@@ -117,7 +117,8 @@ IF(UNIX)
@@ -118,7 +118,8 @@ IF(UNIX)
CONFIGURE_FILE(sysusers.conf.in
${CMAKE_CURRENT_BINARY_DIR}/sysusers.conf @ONLY)
INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/sysusers.conf
@ -27,7 +30,7 @@ index 4ad3810e082..8363922d468 100644
ENDIF()
IF(INSTALL_SYSTEMD_TMPFILESDIR)
@@ -125,7 +126,8 @@ IF(UNIX)
@@ -126,7 +127,8 @@ IF(UNIX)
CONFIGURE_FILE(tmpfiles.conf.in
${CMAKE_CURRENT_BINARY_DIR}/tmpfiles.conf @ONLY)
INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/tmpfiles.conf
@ -37,16 +40,18 @@ index 4ad3810e082..8363922d468 100644
ENDIF()
# @ in directory name broken between CMake version 2.8.12.2 and 3.3
From c86912c8896b65c1dd9226c1bc2987189d4840c2 Mon Sep 17 00:00:00 2001
From 974bd397ff3492c57799e11a02cc3c07081bb1fc Mon Sep 17 00:00:00 2001
From: Christian Hesse <mail@eworm.de>
Date: Tue, 2 Jan 2018 14:36:49 +0100
Subject: Make systemd-tmpfiles create MYSQL_DATADIR
Subject: [PATCH 2/2] Make systemd-tmpfiles create MYSQL_DATADIR
This is a no-op if the directory exists, but makes sure it is created by
systemd-tmpfiles with proper permissions otherwise.
This solves packaging issues when the user MYSQLD_USER is created by
systemd-sysusers and uid is not known in advance.
Signed-off-by: Christian Hesse <mail@eworm.de>
---
support-files/tmpfiles.conf.in | 1 +
1 file changed, 1 insertion(+)

View file

@ -1,56 +0,0 @@
From 8fe9b2658664d0ece15fe57442706446fed66d6e Mon Sep 17 00:00:00 2001
From: Christian Hesse <mail@eworm.de>
Date: Tue, 15 Jan 2019 17:22:56 +0100
Subject: do not break main configuration with instantiated one
The main configuration file /etc/my.cnf includes all configuration files in
/etc/my.cnf.d/. However an instantiated service mariadb@example.service
reads its configuration from /etc/my.cnf.d/myexample.cnf. This breaks
the main configuration as that includes a snippet intended for an instance.
This can be fixed by changing the path: Let the instantiated service
read its configuration from /etc/myexample.cnf.
---
support-files/mariadb@.service.in | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/support-files/mariadb@.service.in b/support-files/mariadb@.service.in
index a2f5cff0828..1207e690f47 100644
--- a/support-files/mariadb@.service.in
+++ b/support-files/mariadb@.service.in
@@ -1,7 +1,7 @@
# Multi instance version of mariadb. For if you run multiple versions at once.
# Also used for mariadb@bootstrap to bootstrap Galera.
#
-# create config file @sysconf2dir@/my{instancename}.cnf
+# create config file @sysconfdir@/my{instancename}.cnf
#
# start as systemctl start mariadb@{instancename}.server
@@ -23,7 +23,7 @@ Documentation=man:mysqld(8)
Documentation=https://mariadb.com/kb/en/library/systemd/
After=network.target
-ConditionPathExists=@sysconf2dir@/my%I.cnf
+ConditionPathExists=@sysconfdir@/my%I.cnf
[Install]
WantedBy=multi-user.target
@@ -75,7 +75,7 @@ PermissionsStartOnly=true
ExecStartPre=/bin/sh -c "systemctl unset-environment _WSREP_START_POSITION%I"
ExecStartPre=/bin/sh -c "[ ! -e @bindir@/galera_recovery ] && VAR= || \
- VAR=`@bindir@/galera_recovery --defaults-file=@sysconf2dir@/my%I.cnf`; [ $? -eq 0 ] \
+ VAR=`@bindir@/galera_recovery --defaults-file=@sysconfdir@/my%I.cnf`; [ $? -eq 0 ] \
&& systemctl set-environment _WSREP_START_POSITION%I=$VAR || exit 1"
# Alternate: (remove ConditionPathExists above)
@@ -96,7 +96,7 @@ ExecStartPre=/bin/sh -c "[ ! -e @bindir@/galera_recovery ] && VAR= || \
# Note: Place $MYSQLD_OPTS at the very end for its options to take precedence.
-ExecStart=@sbindir@/mysqld --defaults-file=@sysconf2dir@/my%I.cnf \
+ExecStart=@sbindir@/mysqld --defaults-file=@sysconfdir@/my%I.cnf \
$_WSREP_NEW_CLUSTER $_WSREP_START_POSITION%I $MYSQLD_OPTS
# Alternate: (remove ConditionPathExists above)
# use [mysqld.INSTANCENAME] as sections in my.cnf

View file

@ -1,7 +1,7 @@
From 5936f0be4a49eda7b05ea1591bbbba3d72e4d7b9 Mon Sep 17 00:00:00 2001
From 471952a37f2523a00d2b4fd617128b3fa9d0cf03 Mon Sep 17 00:00:00 2001
From: Christian Hesse <mail@eworm.de>
Date: Fri, 25 Jan 2019 14:50:53 +0100
Subject: fix galera_recovery with fs.protected_regular enabled
Subject: [PATCH 1/1] fix galera_recovery with fs.protected_regular enabled
The fs.protected_regular sysctls was added in Linux 4.19 to make some
data spoofing attacks harder. With systemd v241 these will be enabled
@ -12,12 +12,14 @@ With this protection enabled galera_recovery fails with EPERM
The script changes ownership of $log_file to $user, though $user never
touches it. The shell redirection writes output to the file, not mysqld.
So just drop chown to fix this.
Signed-off-by: Christian Hesse <mail@eworm.de>
---
scripts/galera_recovery.sh | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/scripts/galera_recovery.sh b/scripts/galera_recovery.sh
index c58f3d8f6b9..c70decc0005 100644
index 709c4b0eed5..8df2abc3fd5 100644
--- a/scripts/galera_recovery.sh
+++ b/scripts/galera_recovery.sh
@@ -101,8 +101,7 @@ wsrep_recover_position() {

View file

@ -0,0 +1,32 @@
From 34ac8a4f31f490db5cec7b6291dc98479c45c78f Mon Sep 17 00:00:00 2001
From: Christian Hesse <mail@eworm.de>
Date: Fri, 1 Mar 2019 10:00:27 +0100
Subject: [PATCH 1/1] systemd service: add instance name in description
The unit files made systemd print:
systemd[1]: Started MariaDB 10.3.13 database server (multi-instance).
Let's add the instance name, so starting mariadb@foo.service
makes it print:
systemd[1]: Started MariaDB 10.3.13 database server (multi-instance foo).
Signed-off-by: Christian Hesse <mail@eworm.de>
---
support-files/mariadb@.service.in | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/support-files/mariadb@.service.in b/support-files/mariadb@.service.in
index 727c1b85301..fd997b2ce3d 100644
--- a/support-files/mariadb@.service.in
+++ b/support-files/mariadb@.service.in
@@ -131,7 +131,7 @@
# systemd.service(5)
[Unit]
-Description=MariaDB @VERSION@ database server (multi-instance)
+Description=MariaDB @VERSION@ database server (multi-instance %I)
Documentation=man:mysqld(8)
Documentation=https://mariadb.com/kb/en/library/systemd/
After=network.target

View file

@ -8,7 +8,7 @@
pkgbase=mariadb
pkgname=('mariadb-libs' 'mariadb-clients' 'mariadb' 'mytop')
pkgdesc='Fast SQL database server, derived from MySQL'
pkgver=10.3.16
pkgver=10.4.6
pkgrel=1
arch=('x86_64')
license=('GPL')
@ -19,16 +19,16 @@ validpgpkeys=('199369E5404BD5FC7D2FE43BCBCB082A1BB943DB') # MariaDB Package Sign
source=("https://mirrors.n-ix.net/mariadb/mariadb-$pkgver/source/mariadb-$pkgver.tar.gz"{,.asc}
'0001-arch-specific.patch'
'0002-systemd-sysusers-tmpfiles.patch'
'0004-do-not-break-main-configuration-with-instantiated-one.patch'
'0005-fix-galera_recovery-with-fs.protected_regular-enabled.patch'
'0007-systemd-service-add-instance-name-in-description.patch'
'atomic.patch')
sha256sums=('39e9723eaf620afd99b0925b2c2a5a50a89110ba50040adf14cce7cf89e5e21b'
sha256sums=('a270fe6169a1aaf6f2cbbc945de2c954d818c48e1a0fc02fbed92ecb94678e70'
'SKIP'
'5b74e328e75369dfb68491a06dd53bd736e34f87281103ae0dd2f50401dc70d3'
'1cd009b473d5965c7cbe6d48fff272030a2ccdd9c7e67b4f837d03252786a09a'
'd12806e4f90cc0fc081205dd4c0a5e0e7c455844f04276811b61b57fd24f5545'
'66e0acac7436fd8925710ef5cc66ba1a8f63a385ce374f01ae83096cc33d97a0'
'7769fd8eb2bb3a6644a2200d01918ff887be25638d79dbec25897fe0d87badc4')
'ce72ea1563ad773e00e8b1c299babea176abae1102827c2f743921e9de615041'
'3e83467af80fbd53400a201a34fc858b88509ea8e88b10709947eb66545f9457'
'c8c801f80924ccb97b499552fe1c532b3ebf8f86cdfc0d23715d4adb1a8810f0'
'd4575c349fdc6268135cd3483e70e04b149ec8004583bac7f79f190a084cbfc8'
'34846fc33eda8600741e7ef48d00ce7a820006d4b731690eca5fa8d726c9c593')
prepare() {
cd $pkgbase-$pkgver/
@ -36,7 +36,7 @@ prepare() {
# Arch Linux specific patches:
# * enable PrivateTmp for a little bit more security
# * force preloading jemalloc for memory management
# * fix path to our config
# * remove aliases in systemd unit files
patch -Np1 < ../0001-arch-specific.patch
# MDEV-17028 Fix glitches with systemd sysusers and tmpfiles:
@ -45,14 +45,14 @@ prepare() {
# https://github.com/MariaDB/server/pull/530
patch -Np1 < ../0002-systemd-sysusers-tmpfiles.patch
# do not break main configuration with instantiated one
# https://github.com/MariaDB/server/pull/1095
patch -Np1 < ../0004-do-not-break-main-configuration-with-instantiated-one.patch
# fix galera_recovery with fs.protected_regular enabled
# https://github.com/MariaDB/server/pull/1137
patch -Np1 < ../0005-fix-galera_recovery-with-fs.protected_regular-enabled.patch
# systemd service: add instance name in description
# https://github.com/MariaDB/server/pull/1216
patch -Np1 < ../0007-systemd-service-add-instance-name-in-description.patch
if [[ $CARCH == arm || $CARCH == armv6h ]]; then
patch -p0 -i ../atomic.patch
fi
@ -66,8 +66,8 @@ build() {
# file paths
# /etc
-DINSTALL_SYSCONFDIR=/etc/mysql
-DINSTALL_SYSCONF2DIR=/etc/mysql/my.cnf.d
-DINSTALL_SYSCONFDIR=/etc
-DINSTALL_SYSCONF2DIR=/etc/my.cnf.d
# /run
-DINSTALL_UNIX_ADDRDIR=/run/mysqld/mysqld.sock
# /usr
@ -170,11 +170,11 @@ package_mariadb-clients() {
package_mariadb() {
pkgdesc='Fast SQL database server, derived from MySQL'
backup=('etc/mysql/my.cnf'
'etc/mysql/my.cnf.d/client.cnf'
'etc/mysql/my.cnf.d/enable_encryption.preset'
'etc/mysql/my.cnf.d/mysql-clients.cnf'
'etc/mysql/my.cnf.d/server.cnf')
backup=('etc/my.cnf'
'etc/my.cnf.d/client.cnf'
'etc/my.cnf.d/enable_encryption.preset'
'etc/my.cnf.d/mysql-clients.cnf'
'etc/my.cnf.d/server.cnf')
install=mariadb.install
depends=("mariadb-clients=${pkgver}" 'inetutils' 'systemd-libs' 'libxml2' 'zstd')
optdepends=('galera: for MariaDB cluster with Galera WSREP'
@ -190,7 +190,7 @@ package_mariadb() {
cd "$pkgdir"
# no SysV init, please!
rm -r etc/mysql/{init.d,logrotate.d}
rm -r etc/logrotate.d
rm usr/bin/rcmysql
rm usr/share/mysql/{binary-configure,mysql{,d_multi}.server}
@ -216,12 +216,13 @@ package_mariadb() {
rm usr/share/man/man1/mysql_config.1
rm -r usr/share/{aclocal,pkgconfig}
rm usr/lib/lib*
rm usr/lib/mysql/plugin/{auth_gssapi_client,caching_sha2_password,dialog,mysql_clear_password,sha256_password}.so
rm usr/lib/mysql/plugin/{auth_gssapi_client,caching_sha2_password,client_ed25519,dialog,mysql_clear_password,sha256_password}.so
rm -r usr/lib/pkgconfig/
# provided by mariadb-clients
rm usr/bin/{mysql,mysql_plugin,mysql_upgrade,mysqladmin,mysqlbinlog,mysqlcheck,mysqldump,mysqlimport,mysqlshow,mysqlslap,mysqltest}
rm usr/share/man/man1/{mysql,mysql_plugin,mysql_upgrade,mysqladmin,mysqlbinlog,mysqlcheck,mysqldump,mysqlimport,mysqlshow,mysqlslap,mysqltest}.1
rm usr/bin/mysql{,_plugin,_upgrade,admin,binlog,check,dump,import,show,slap,test}
rm usr/bin/mariadb{,-{admin,binlog,check,dump,import,plugin,show,slap,test,upgrade}}
rm usr/share/man/man1/mysql{,_plugin,_upgrade,admin,binlog,check,dump,import,show,slap,test}.1
# provided by mytop
rm usr/bin/mytop

View file

@ -1,6 +1,6 @@
--- libmysqld/CMakeLists.txt.orig 2019-01-04 08:28:48.000000000 -0700
+++ libmysqld/CMakeLists.txt 2019-01-17 06:52:10.668544469 -0700
@@ -150,6 +150,7 @@
--- libmysqld/CMakeLists.txt.orig 2019-06-17 16:00:31.000000000 -0600
+++ libmysqld/CMakeLists.txt 2019-06-27 12:22:55.490388083 -0600
@@ -154,6 +154,7 @@
${LIBWRAP} ${LIBCRYPT} ${LIBDL}
${MYSQLD_STATIC_PLUGIN_LIBS}
sql_embedded
@ -8,9 +8,9 @@
)
# Some storage engine were compiled for embedded specifically
--- sql/CMakeLists.txt.orig 2019-01-04 08:28:49.000000000 -0700
+++ sql/CMakeLists.txt 2019-01-17 06:52:10.672544438 -0700
@@ -169,7 +169,8 @@
--- sql/CMakeLists.txt.orig 2019-06-17 16:00:32.000000000 -0600
+++ sql/CMakeLists.txt 2019-06-27 12:22:55.490388083 -0600
@@ -181,7 +181,8 @@
${LIBWRAP} ${LIBCRYPT} ${LIBDL} ${CMAKE_THREAD_LIBS_INIT}
${WSREP_LIB}
${SSL_LIBRARIES}
@ -20,14 +20,14 @@
IF(WIN32)
SET(MYSQLD_SOURCE main.cc nt_servc.cc message.rc)
--- storage/rocksdb/build_rocksdb.cmake.orig 2019-01-17 07:52:59.896149354 -0700
+++ storage/rocksdb/build_rocksdb.cmake 2019-01-17 07:53:34.996081204 -0700
@@ -423,7 +423,7 @@
--- storage/rocksdb/build_rocksdb.cmake.orig 2019-06-27 12:22:49.450397299 -0600
+++ storage/rocksdb/build_rocksdb.cmake 2019-06-27 12:22:55.494388077 -0600
@@ -448,7 +448,7 @@
list(APPEND SOURCES ${CMAKE_CURRENT_BINARY_DIR}/build_version.cc)
ADD_CONVENIENCE_LIBRARY(rocksdblib ${SOURCES})
-target_link_libraries(rocksdblib ${THIRDPARTY_LIBS} ${SYSTEM_LIBS})
+target_link_libraries(rocksdblib ${THIRDPARTY_LIBS} ${SYSTEM_LIBS} atomic)
IF(CMAKE_CXX_COMPILER_ID MATCHES "GNU" OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
set_target_properties(rocksdblib PROPERTIES COMPILE_FLAGS "-fPIC -fno-builtin-memcmp -frtti")
set_target_properties(rocksdblib PROPERTIES COMPILE_FLAGS "-fPIC -fno-builtin-memcmp")
endif()

View file

@ -3,13 +3,23 @@
post_install() {
echo ":: You need to initialize the MariaDB data directory prior to starting"
echo " the service. This can be done with mysql_install_db command, e.g.:"
echo " mysql_install_db --user=mysql --basedir=/usr --datadir=/var/lib/mysql"
echo " mariadb-install-db --user=mysql --basedir=/usr --datadir=/var/lib/mysql"
}
post_upgrade() {
# show for feature release: 10.1 -> 10.2 -> 10.3 -> ...
if [ $(vercmp "${1%.*-*}" "${2%.*-*}") -ne 0 ]; then
echo ":: MariaDB was updated to a new feature release. To update the data run:"
echo " systemctl restart mariadb.service && mysql_upgrade -u root -p"
echo " systemctl restart mariadb.service && mariadb-upgrade -u root -p"
fi
# return if old package version greater 10.4...
(( $(vercmp $2 '10.4') > 0 )) && return
# upgrade from pre-10.4...
echo ":: MariaDB configuration layout changed."
echo " -> The main configuration file now is: /etc/my.cnf"
echo " -> Instantiated services (mariadb@foo.service) do not longer read their"
echo " own configuration file but use group suffix (configuration block"
echo " '[mysqld.foo]') in main configuration file."
}