* Fri Apr 04 2025 Jean-Philippe Pialasse <jpp@koozali.org> 11.0.0-12.sme
- restore root user, pasword and socket login [SME: 12978]
This commit is contained in:
parent
2d41a90503
commit
e78f90c5e5
@ -1 +0,0 @@
|
|||||||
sme10
|
|
@ -15,7 +15,8 @@ safe_symlink("/usr/bin/mariadb-binlog","root/usr/bin/mysqlbinlog");
|
|||||||
safe_symlink("/usr/bin/mariadb-convert-table-format","root/usr/bin/mysql_convert_table_format");
|
safe_symlink("/usr/bin/mariadb-convert-table-format","root/usr/bin/mysql_convert_table_format");
|
||||||
safe_symlink("/usr/bin/mariadb-find-rows","root/usr/bin/mysql_find_rows");
|
safe_symlink("/usr/bin/mariadb-find-rows","root/usr/bin/mysql_find_rows");
|
||||||
safe_symlink("/usr/bin/mariadb-fix-extensions","root/usr/bin/mysql_fix_extensions");
|
safe_symlink("/usr/bin/mariadb-fix-extensions","root/usr/bin/mysql_fix_extensions");
|
||||||
|
safe_symlink("/usr/bin/mariadb-install-db","root/usr/bin/mysql_install_db");
|
||||||
|
safe_symlink("/usr/bin/mariadb-embedded","root/usr/bin/mysql_embedded");
|
||||||
|
|
||||||
#--------------------------------------------------
|
#--------------------------------------------------
|
||||||
# pre-backup actions
|
# pre-backup actions
|
||||||
|
@ -4,6 +4,14 @@
|
|||||||
my $pw = esmith::util::LdapPassword();
|
my $pw = esmith::util::LdapPassword();
|
||||||
|
|
||||||
$OUT .= "use mysql;\n";
|
$OUT .= "use mysql;\n";
|
||||||
$OUT .= "SET PASSWORD FOR 'root'\@localhost = PASSWORD(\"$pw\"); \n";
|
$OUT .= "FLUSH PRIVILEGES;\n";
|
||||||
|
$OUT .= "CREATE OR REPLACE USER 'root'\@localhost IDENTIFIED VIA unix_socket OR mysql_native_password USING PASSWORD(\"$pw\"); \n";
|
||||||
|
$OUT .= "GRANT ALL PRIVILEGES ON *.* TO `root`@`localhost` WITH GRANT OPTION; \n";
|
||||||
|
$OUT .= "FLUSH PRIVILEGES;\n";
|
||||||
|
# will not work as requires the With_grant privilege.... but accepts second line to alter the table to give it...
|
||||||
|
#$OUT .= "GRANT PROXY ON ``@`` TO `root`\@localhost WITH GRANT OPTION;\n";
|
||||||
|
$OUT .= "REPLACE INTO `proxies_priv` (`Host`, `User`, `Proxied_host`, `Proxied_user`, `With_grant`, `Grantor`, `Timestamp`) VALUES
|
||||||
|
('localhost', 'root', '', '', 1, '', current_timestamp()),
|
||||||
|
('$SystemName.$DomainName', 'root', '', '', 1, '', current_timestamp());\n";
|
||||||
$OUT .= "FLUSH PRIVILEGES;\n";
|
$OUT .= "FLUSH PRIVILEGES;\n";
|
||||||
}
|
}
|
||||||
|
@ -3,9 +3,13 @@
|
|||||||
exec 2>&1
|
exec 2>&1
|
||||||
if [ ! -f /var/lib/mysql/mysql/user.frm ]
|
if [ ! -f /var/lib/mysql/mysql/user.frm ]
|
||||||
then
|
then
|
||||||
setuidgid mysql sh /usr/bin/mysql_install_db --rpm --skip-test-db --user=mysql --group=mysql
|
setuidgid mysql sh /usr/bin/mariadb-install-db --rpm --skip-test-db --user=mysql --group=mysql
|
||||||
if [ -f /home/e-smith/db/mysql/mysql.dump ]
|
if [ -f /home/e-smith/db/mysql/mysql.dump ]
|
||||||
then
|
then
|
||||||
/sbin/e-smith/expand-template /etc/e-smith/sql/init/00_restore_dumped_dbs
|
/sbin/e-smith/expand-template /etc/e-smith/sql/init/00_restore_dumped_dbs
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# set root password and access to socket passwordless
|
||||||
|
/usr/sbin/mariadbd --socket=/var/lib/mysql/mysql.sock --bootstrap --user=mysql < /var/lib/mysql.private/set.password
|
||||||
|
exit 0
|
||||||
|
@ -1,18 +0,0 @@
|
|||||||
#!/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
|
|
||||||
|
|
@ -36,8 +36,6 @@ ExecStart=/usr/sbin/mariadbd \
|
|||||||
--user=mysql \
|
--user=mysql \
|
||||||
--pid-file=/run/mariadb/mariadb.pid
|
--pid-file=/run/mariadb/mariadb.pid
|
||||||
|
|
||||||
ExecStartPost=-/sbin/e-smith/systemd/mariadb-post
|
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=sme-server.target
|
WantedBy=sme-server.target
|
||||||
|
|
||||||
|
@ -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 11
|
%define release 12
|
||||||
Version: %{version}
|
Version: %{version}
|
||||||
Release: %{release}%{?dist}
|
Release: %{release}%{?dist}
|
||||||
License: GPL
|
License: GPL
|
||||||
@ -79,6 +79,9 @@ rm -rf $RPM_BUILD_ROOT
|
|||||||
%defattr(-,root,root)
|
%defattr(-,root,root)
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Fri Apr 04 2025 Jean-Philippe Pialasse <jpp@koozali.org> 11.0.0-12.sme
|
||||||
|
- restore root user, pasword and socket login [SME: 12978]
|
||||||
|
|
||||||
* Fri Mar 07 2025 Jean-Philippe Pialasse <jpp@koozali.org> 11.0.0-11.sme
|
* Fri Mar 07 2025 Jean-Philippe Pialasse <jpp@koozali.org> 11.0.0-11.sme
|
||||||
- upgrade to support mariadb 11.4 [SME: 12930]
|
- upgrade to support mariadb 11.4 [SME: 12930]
|
||||||
move mariadb-upgrade to mysql.init unit
|
move mariadb-upgrade to mysql.init unit
|
||||||
|
Loading…
x
Reference in New Issue
Block a user