* Fri Apr 05 2024 Jean-Philippe Pialasse <jpp@koozali.org> 11.0.0-4.sme

- tidy spec and sources for mariadb10.5 support [SME: 12524]
- try to make compatible with higher version from mariadb repo [SME: 11856]
- fix logrotate duplicate entry [SME: 12554]

* Thu Apr 04 2024 Brian Read <brianr@koozali.org> 11.0.0-3.sme
- Set license file to GPL2.0  [SME: 12577]
This commit is contained in:
2024-04-06 00:48:58 -04:00
parent 7e830858f7
commit fbc84843d3
28 changed files with 24 additions and 829 deletions

View File

@@ -1,6 +1,6 @@
{
# InnoDB is mandatory with mariadb
my $a = $DB->get("mariadb") or return;
return unless (exists $mariadb{'InnoDB'});
$DB->get_prop_and_delete('mariadb', 'InnoDB');
$DB->get_prop_and_delete('mariadb', 'InnoDB') if (exists $mariadb{'InnoDB'});
$DB->get_prop_and_delete('mariadb', 'innodb_file_format') if (exists $mariadb{'innodb_file_format'});
}

View File

@@ -1,3 +0,0 @@
PERMS=0400
UID="root"
GID="root"

View File

@@ -1,7 +1,7 @@
#! /bin/sh
( cat /home/e-smith/db/mysql/mysql.dump ;
cat /var/lib/mysql/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
/usr/bin/systemctl restart mariadb.service

View File

@@ -1,14 +1,5 @@
#innodb
{# https://mariadb.com/kb/en/innodb-system-variables/#innodb_large_prefix
#default Off up to 10.2.1
# removed in 10.3.1 and 10.6.0
# keep it there up to 10.2.2
}innodb_large_prefix=1
{#https://mariadb.com/kb/en/innodb-system-variables/#innodb_file_format
# default is antelope up to 10.2.1
# keep it up to 10.2.2
}innodb_file_format={ $mariadb{'innodb_file_format'}||'barracuda' }
{# enabled is already the default
}innodb_file_per_table={ $mariadb{'innodb_file_per_table'}||'1' }

View File

@@ -1,4 +1,2 @@
{ # allow backwards-compatibility with safe_mysqld (mysql < 4.0)
-f "/usr/bin/mysqld_safe" ? "[mysqld_safe]" : "[safe_mysqld]";
}
[mysqld_safe]

View File

@@ -1,14 +1,4 @@
# *-mysql.init
:programname, isequal, "mysql.init" /var/log/mysql.init/mysql.init.log
& stop
:programname, isequal, "mariadb105-mysql.init" /var/log/mysql.init/mariadb105-mysql.init.log
& stop
:programname, isequal, "mariadb103-mysql.init" /var/log/mysql.init/mariadb103-mysql.init.log
& stop
:programname, isequal, "mariadb102-mysql.init" /var/log/mysql.init/mariadb102-mysql.init.log
& stop
:programname, isequal, "mariadb101-mysql.init" /var/log/mysql.init/mariadb101-mysql.init.log
& stop
:programname, isequal, "mysql57-mysql.init" /var/log/mysql.init/mysql57-mysql.init.log
& stop

View File

@@ -1,12 +0,0 @@
{
use esmith::util;
my $pw = esmith::util::LdapPassword();
$OUT .= "use mysql;\n";
$OUT .= "ALTER TABLE user MODIFY Password char(41) NOT NULL default '';\n";
$OUT .= "UPDATE user SET password=password('$pw') WHERE user='root';\n";
$OUT .= "DELETE FROM db WHERE user='';\n";
$OUT .= "DELETE FROM user WHERE user='';\n";
$OUT .= "FLUSH PRIVILEGES;\n";
}

View File

@@ -1,17 +0,0 @@
/var/log/mariadb/*.log {
create 640 mysql mysql
notifempty
daily
rotate 3
missingok
compress
postrotate
# just if mysqld is really running
if test -x /usr/bin/mysqladmin && \
/usr/bin/mysqladmin ping &>/dev/null
then
/usr/bin/mysqladmin flush-logs
fi
endscript
}

View File

@@ -3,12 +3,9 @@
exec 2>&1
if [ ! -f /var/lib/mysql/mysql/user.frm ]
then
setuidgid mysql sh /usr/bin/mysql_install_db
/usr/libexec/mysqld --bootstrap --user=mysql --skip-grant-tables < /var/lib/mysql/set.password
setuidgid mysql sh /usr/bin/mysql_install_db --rpm --skip-test-db --user=mysql --group=mysql
if [ -f /home/e-smith/db/mysql/mysql.dump ]
then
/sbin/e-smith/expand-template /etc/e-smith/sql/init/00_restore_dumped_dbs
fi
else
/usr/libexec/mysqld --bootstrap --user=mysql --skip-grant-tables < /var/lib/mysql/set.password
fi

View File

@@ -0,0 +1,18 @@
#!/bin/bash
for i in $(seq 1 20);
do
if [ -S /var/lib/mysql/mysql.sock ]
then
/usr/bin/mysql < /var/lib/mysql.private/set.password
echo "root password set"
exit 0
fi
echo waiting for mariadb to start to set root password
sleep 1
done
echo failed to set root password
# we fail silently, mariadb will still work, only issue is for phpmyadmin
# and non socket access
exit 0

View File

@@ -65,7 +65,7 @@ do
done
exit $exit_value
fi
echo "Waiting for mysql to startup" >&2
echo "Waiting for mariadb to startup" >&2
sleep 2
done

View File

@@ -4,15 +4,15 @@ After=syslog.target
After=network.target
[Service]
Type=simple
User=root
Group=root
#allow our expand-templates
PermissionsStartOnly=true
#reset
ExecStartPre=
#ours : we need root user as + and ! are not yet supported
ExecStartPre=/usr/libexec/mysql-check-socket
ExecStartPre=-/sbin/e-smith/service-status mariadb
ExecStartPre=-/sbin/e-smith/expand-template /var/lib/mysql/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 /etc/my.cnf
ExecStartPre=/sbin/e-smith/systemd/mariadb-initialize
@@ -27,16 +27,7 @@ ExecStart=/usr/libexec/mysqld \
--user=mysql \
--pid-file=/var/run/mariadb/mariadb.pid
#reset
ExecStartPost=
#ours
ExecStartPost=/usr/libexec/mariadb-wait-ready $MAINPID
# Give a reasonable amount of time for the server to start up/shut down
TimeoutSec=300
# Place temp files in a secure directory, not /tmp
PrivateTmp=true
ExecStartPost=-/sbin/e-smith/systemd/mariadb-post
[Install]
WantedBy=sme-server.target