* Fri Mar 07 2025 Jean-Philippe Pialasse <jpp@koozali.org> 11.0.0-9.sme
- upgrade to support mariadb 11.4 [SME: 12930] move mariadb-upgrade to mysql.init unit, remove duplicate in 00_restore_dumped_dbs and 10mysql_upgrade add our tmp.d add post action dnf script update mariadb.service.d/ content set default to utfmb4 - TODO mysql.dump filtering [SME: 12592] - TODO feedback plugin [SME: 12897] * Sun Jan 26 2025 Jean-Philippe Pialasse <jpp@koozali.org> 11.0.0-8.sme - prestart script requires daemontools bins [SME: 12566]
This commit is contained in:
parent
34effb2c39
commit
afcd41481e
@ -41,7 +41,6 @@ foreach (qw(
|
|||||||
|
|
||||||
# Move all database dumps except for mysql.dump to sql/init
|
# Move all database dumps except for mysql.dump to sql/init
|
||||||
event_link("mysql-load-tables", $event, "40");
|
event_link("mysql-load-tables", $event, "40");
|
||||||
templates2events("/etc/e-smith/sql/init/10mysql_upgrade", $event);
|
|
||||||
|
|
||||||
|
|
||||||
#--------------------------------------------------
|
#--------------------------------------------------
|
||||||
@ -70,7 +69,6 @@ safe_symlink("restart", "root/etc/e-smith/events/$event/services2adjust/mysql.in
|
|||||||
safe_symlink("restart", "root/etc/e-smith/events/$event/services2adjust/rsyslog");
|
safe_symlink("restart", "root/etc/e-smith/events/$event/services2adjust/rsyslog");
|
||||||
# Move all database dumps except for mysql.dump to sql/init
|
# Move all database dumps except for mysql.dump to sql/init
|
||||||
event_link("mysql-load-tables", $event, "40");
|
event_link("mysql-load-tables", $event, "40");
|
||||||
templates2events("/etc/e-smith/sql/init/10mysql_upgrade", $event);
|
|
||||||
templates2events("/etc/rsyslog.conf", $event);
|
templates2events("/etc/rsyslog.conf", $event);
|
||||||
|
|
||||||
# systemd-specific action mandatory for this package-update event
|
# systemd-specific action mandatory for this package-update event
|
||||||
|
@ -0,0 +1,2 @@
|
|||||||
|
mariadb*:any:/sbin/e-smith/signal-event smeserver-mysql-update
|
||||||
|
MariaDB*:any:/sbin/e-smith/signal-event smeserver-mysql-update
|
@ -2,7 +2,6 @@
|
|||||||
|
|
||||||
( cat /home/e-smith/db/mysql/mysql.dump ;
|
( cat /home/e-smith/db/mysql/mysql.dump ;
|
||||||
cat /var/lib/mysql.private/set.password ) | mysql || exit 1
|
cat /var/lib/mysql.private/set.password ) | mysql || exit 1
|
||||||
/usr/bin/mysql_upgrade
|
|
||||||
/bin/rm /var/run/mariadb/mariadb.pid
|
/bin/rm /var/run/mariadb/mariadb.pid
|
||||||
/usr/bin/systemctl restart mariadb.service
|
/usr/bin/systemctl restart mariadb.service
|
||||||
for i in $(seq 1 20);
|
for i in $(seq 1 20);
|
||||||
|
@ -1,16 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
/usr/bin/mysql_upgrade
|
|
||||||
|
|
||||||
/bin/rm /var/run/mariadb/mariadb.pid
|
|
||||||
/usr/bin/systemctl restart mariadb.service
|
|
||||||
for i in $(seq 1 20);
|
|
||||||
do
|
|
||||||
if [ -f /var/run/mariadb/mariadb.pid ]
|
|
||||||
then
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
echo waiting for mysqld to restart
|
|
||||||
sleep 1
|
|
||||||
done
|
|
||||||
echo mysqld failed to restart
|
|
||||||
exit 1
|
|
3
root/etc/e-smith/templates/etc/my.cnf/001client
Normal file
3
root/etc/e-smith/templates/etc/my.cnf/001client
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
[client]
|
||||||
|
default-character-set = utf8mb4
|
||||||
|
|
3
root/etc/e-smith/templates/etc/my.cnf/003mysql
Normal file
3
root/etc/e-smith/templates/etc/my.cnf/003mysql
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
[mysql]
|
||||||
|
default-character-set = utf8mb4
|
||||||
|
|
11
root/etc/e-smith/templates/etc/my.cnf/006charset
Normal file
11
root/etc/e-smith/templates/etc/my.cnf/006charset
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
{
|
||||||
|
# starting mariadb 10.6 , utf8 changes to utf8mb3 (as utf8 used to be an alias of utfmb3)
|
||||||
|
# utf8 will soon be an alias of utf8mb4, and more and mroe db are demanding utf8mb4
|
||||||
|
# so we are better default to it in 2025.
|
||||||
|
# old-mode will force utf8mb3 for character-set-system
|
||||||
|
}
|
||||||
|
character-set-client-handshake = FALSE
|
||||||
|
collation-server = utf8mb4_unicode_ci
|
||||||
|
init-connect = 'SET NAMES utf8mb4 COLLATE utf8mb4_unicode_ci'
|
||||||
|
character-set-server = utf8mb4
|
||||||
|
old-mode = ''
|
@ -4,23 +4,32 @@ After=syslog.target
|
|||||||
After=network.target
|
After=network.target
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
#allow our expand-templates
|
#allow to run as root pre and post
|
||||||
PermissionsStartOnly=true
|
PermissionsStartOnly=true
|
||||||
|
|
||||||
#reset
|
#reset
|
||||||
ExecStartPre=
|
ExecStartPre=
|
||||||
|
ExecStartPre=/usr/bin/install -d /var/run/mariadb -o mysql -g mysql -m 0755
|
||||||
|
|
||||||
|
# add mariadb >=10.6 specifics
|
||||||
|
ExecStartPre=/bin/sh -c "systemctl unset-environment _WSREP_START_POSITION"
|
||||||
|
ExecStartPre=/bin/sh -c "[ ! -e /usr/bin/galera_recovery ] && VAR= || \
|
||||||
|
VAR=`/usr/bin/galera_recovery`; [ $? -eq 0 ] \
|
||||||
|
&& systemctl set-environment _WSREP_START_POSITION=$VAR || exit 1"
|
||||||
|
|
||||||
#ours : we need root user as + and ! are not yet supported
|
#ours : we need root user as + and ! are not yet supported
|
||||||
ExecStartPre=/usr/libexec/mysql-check-socket
|
#ExecStartPre=/usr/libexec/mysql-check-socket
|
||||||
ExecStartPre=-/sbin/e-smith/service-status mariadb
|
ExecStartPre=-/sbin/e-smith/service-status mariadb
|
||||||
ExecStartPre=-/sbin/e-smith/expand-template /var/lib/mysql.private/set.password
|
ExecStartPre=-/sbin/e-smith/expand-template /var/lib/mysql.private/set.password
|
||||||
ExecStartPre=-/sbin/e-smith/expand-template /root/.my.cnf
|
ExecStartPre=-/sbin/e-smith/expand-template /root/.my.cnf
|
||||||
ExecStartPre=-/sbin/e-smith/expand-template /etc/my.cnf
|
ExecStartPre=-/sbin/e-smith/expand-template /etc/my.cnf
|
||||||
|
# create db here if needed
|
||||||
ExecStartPre=/sbin/e-smith/systemd/mariadb-initialize
|
ExecStartPre=/sbin/e-smith/systemd/mariadb-initialize
|
||||||
|
|
||||||
#reset
|
#reset
|
||||||
ExecStart=
|
ExecStart=
|
||||||
#ours
|
#ours
|
||||||
ExecStart=/usr/libexec/mysqld \
|
ExecStart=/usr/sbin/mariadbd \
|
||||||
--defaults-file=/etc/my.cnf \
|
--defaults-file=/etc/my.cnf \
|
||||||
--basedir=/usr \
|
--basedir=/usr \
|
||||||
--datadir=/var/lib/mysql \
|
--datadir=/var/lib/mysql \
|
||||||
|
@ -11,8 +11,10 @@ IgnoreSIGPIPE=no
|
|||||||
KillMode=process
|
KillMode=process
|
||||||
GuessMainPID=no
|
GuessMainPID=no
|
||||||
RemainAfterExit=yes
|
RemainAfterExit=yes
|
||||||
|
ExecStart=-/usr/bin/mariadb-upgrade
|
||||||
ExecStart=/sbin/e-smith/systemd/mysql.init start
|
ExecStart=/sbin/e-smith/systemd/mysql.init start
|
||||||
ExecStop=/sbin/e-smith/systemd/mysql.init stop
|
ExecStop=/sbin/e-smith/systemd/mysql.init stop
|
||||||
|
SyslogIdentifier=mysql.init
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=sme-server.target
|
WantedBy=sme-server.target
|
||||||
|
1
root/usr/lib/tmpfiles.d/smemariadb.conf
Normal file
1
root/usr/lib/tmpfiles.d/smemariadb.conf
Normal file
@ -0,0 +1 @@
|
|||||||
|
d /var/run/mariadb 0755 mysql mysql -
|
@ -2,7 +2,7 @@ Summary: Koozali SME Server specific mysql configuration and templates.
|
|||||||
%define name smeserver-mysql
|
%define name smeserver-mysql
|
||||||
Name: %{name}
|
Name: %{name}
|
||||||
%define version 11.0.0
|
%define version 11.0.0
|
||||||
%define release 8
|
%define release 9
|
||||||
Version: %{version}
|
Version: %{version}
|
||||||
Release: %{release}%{?dist}
|
Release: %{release}%{?dist}
|
||||||
License: GPL
|
License: GPL
|
||||||
@ -13,8 +13,7 @@ BuildRoot: /var/tmp/%{name}-%{version}-%{release}-buildroot
|
|||||||
BuildArchitectures: noarch
|
BuildArchitectures: noarch
|
||||||
Requires: mariadb-server
|
Requires: mariadb-server
|
||||||
# mariadb after 5.5 /in Centos 8 will package mysql_upgrade in mariadb-server-utils
|
# mariadb after 5.5 /in Centos 8 will package mysql_upgrade in mariadb-server-utils
|
||||||
Requires: /usr/bin/mysql_upgrade
|
Requires: /usr/bin/mariadb-upgrade
|
||||||
Requires: mariadb > 10.5.0
|
|
||||||
Requires: smeserver-base
|
Requires: smeserver-base
|
||||||
Requires: smeserver-lib >= 1.15.1-19
|
Requires: smeserver-lib >= 1.15.1-19
|
||||||
# daemontools bins in use
|
# daemontools bins in use
|
||||||
@ -22,6 +21,17 @@ Requires: /usr/bin/setuidgid
|
|||||||
Provides: e-smith-mysql = 2.7.0
|
Provides: e-smith-mysql = 2.7.0
|
||||||
Obsoletes: e-smith-mysql < 2.7.0
|
Obsoletes: e-smith-mysql < 2.7.0
|
||||||
BuildRequires: smeserver-devtools >= 1.13.1-03
|
BuildRequires: smeserver-devtools >= 1.13.1-03
|
||||||
|
# MariaDB from MariaDB repo
|
||||||
|
Requires: mariadb-server >= 10.6.0
|
||||||
|
Requires: mariadb >= 10.6.0
|
||||||
|
Requires: mariadb-backup
|
||||||
|
Requires: mariadb-connector-c >= 3.3.14
|
||||||
|
Requires: mariadb-connector-c-config
|
||||||
|
Requires: MariaDB-connect-engine
|
||||||
|
Requires: MariaDB-gssapi-server
|
||||||
|
Requires: MariaDB-compat
|
||||||
|
Requires: mariadb-common ,mariadb-errmsg,mariadb-server-utils
|
||||||
|
|
||||||
AutoReqProv: no
|
AutoReqProv: no
|
||||||
|
|
||||||
%description
|
%description
|
||||||
@ -53,12 +63,6 @@ echo "%doc COPYING" >> %{name}-%{version}-filelist
|
|||||||
rm -rf $RPM_BUILD_ROOT
|
rm -rf $RPM_BUILD_ROOT
|
||||||
|
|
||||||
%pre
|
%pre
|
||||||
if [ $1 -gt 1 ] ; then
|
|
||||||
if [ -e /var/service/mariadb/run ] ; then
|
|
||||||
/usr/bin/sv d mariadb
|
|
||||||
/usr/bin/sv d mariadb/log
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
%post
|
%post
|
||||||
|
|
||||||
@ -68,6 +72,16 @@ fi
|
|||||||
%defattr(-,root,root)
|
%defattr(-,root,root)
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Fri Mar 07 2025 Jean-Philippe Pialasse <jpp@koozali.org> 11.0.0-9.sme
|
||||||
|
- upgrade to support mariadb 11.4 [SME: 12930]
|
||||||
|
move mariadb-upgrade to mysql.init unit, remove duplicate in 00_restore_dumped_dbs and 10mysql_upgrade
|
||||||
|
add our tmp.d
|
||||||
|
add post action dnf script
|
||||||
|
update mariadb.service.d/ content
|
||||||
|
set default to utfmb4
|
||||||
|
- TODO mysql.dump filtering [SME: 12592]
|
||||||
|
- TODO feedback plugin [SME: 12897]
|
||||||
|
|
||||||
* Sun Jan 26 2025 Jean-Philippe Pialasse <jpp@koozali.org> 11.0.0-8.sme
|
* Sun Jan 26 2025 Jean-Philippe Pialasse <jpp@koozali.org> 11.0.0-8.sme
|
||||||
- prestart script requires daemontools bins [SME: 12566]
|
- prestart script requires daemontools bins [SME: 12566]
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user