Details
Description
Originally reported as
https://issues.redhat.com/browse/RHEL-25575
Even when a user sets --baseurl=/usr which is valid prefix, the mysql_install_db script fails.
After a bit of debugging, I found a code branch that tries to look for a plugin that might not exist in paths that do not list all possible options:
A suggested fix:
diff -up mariadb-10.11.6/scripts/mysql_install_db.sh.plugindir mariadb-10.11.6/scripts/mysql_install_db.sh
|
--- mariadb-10.11.6/scripts/mysql_install_db.sh.plugindir 2024-02-19 17:37:53.677617656 +0100
|
+++ mariadb-10.11.6/scripts/mysql_install_db.sh 2024-02-19 17:41:27.907002490 +0100
|
@@ -370,7 +370,7 @@ then
|
cannot_find_file fill_help_tables.sql @pkgdata_locations@
|
exit 1
|
fi
|
- plugindir=`find_in_dirs --dir auth_pam.so $basedir/lib*/plugin $basedir/lib*/mysql/plugin $basedir/lib/*/mariadb19/plugin`
|
+ plugindir=`find_in_dirs --dir type_mysql_json.so $basedir/lib*/plugin $basedir/lib*/mariadb/plugin $basedir/lib*/mysql/plugin $basedir/lib/*/mariadb19/plugin`
|
pamtooldir=$plugindir
|
# relative from where the script was run for a relocatable install
|
elif test -n "$dirname0" -a -x "$rel_mysqld" -a ! "$rel_mysqld" -ef "@sbindir@/mariadbd"
|
Attachments
Issue Links
- is duplicated by
-
MDEV-33550 MariaDB server fails to start when basedir set to anything
-
- Closed
-
Thanks hhorak.
Contributing factors.
pam as separate package means that the pam_so isn't there (yet?)
[root@b54bfac133fd /]# rpm -ql mariadb-pam-10.11.6-3.fc40.x86_64.rpm
/etc/security/user_map.conf
/usr/lib/.build-id
/usr/lib/.build-id/07/bb2bad7cdbbedf0132b4073043d52a2a88c118
/usr/lib/.build-id/29
/usr/lib/.build-id/29/bb6d481fc74fa69416fafa2e6533836a90ad76
/usr/lib/.build-id/7d/142ef00109c4ab000192acd4bb90124e0bd2d2
/usr/lib/.build-id/e7/4c9731d65d2bedb52335a4f94ffa27bdb854b2
/usr/lib64/mariadb/plugin/auth_pam.so
/usr/lib64/mariadb/plugin/auth_pam_tool_dir
/usr/lib64/mariadb/plugin/auth_pam_tool_dir/auth_pam_tool
/usr/lib64/mariadb/plugin/auth_pam_v1.so
/usr/lib64/security/pam_user_map.so
INSTALL_PLUGINDIR="%{_lib}/%
{majorname}/plugin"
https://src.fedoraproject.org/rpms/mariadb10.11/blob/rawhide/f/mariadb10.11.spec#_857
means some of the mysql_install_db is out of date.
No idea why Otto added client plugin dirs in b9dea911bf8e.
Leaning towards a solution that throws a bunch of heuristic junk out like:
diff --git a/scripts/mysql_install_db.sh b/scripts/mysql_install_db.sh
index 742eb1e17cf..05182e27f97 100644
--- a/scripts/mysql_install_db.sh
+++ b/scripts/mysql_install_db.sh
@@ -344,33 +344,13 @@ then
pamtooldir="$builddir/plugin/auth_pam"
elif test -n "$basedir"
then
- bindir="$basedir/bin" # only used in the help text
- resolveip=`find_in_dirs resolveip @resolveip_locations@`
- if test -z "$resolveip"
- then
- cannot_find_file resolveip @resolveip_locations@
- exit 1
- fi
- mysqld=`find_in_dirs mariadbd @mysqld_locations@`
- if test -z "$mysqld"
- then
- cannot_find_file mariadbd @mysqld_locations@
- exit 1
- fi
- langdir=`find_in_dirs --dir errmsg.sys @errmsg_locations@`
- if test -z "$langdir"
- then
- cannot_find_file errmsg.sys @errmsg_locations@
- exit 1
- fi
- srcpkgdatadir=`find_in_dirs --dir fill_help_tables.sql @pkgdata_locations@`
- buildpkgdatadir=$srcpkgdatadir
- if test -z "$srcpkgdatadir"
- then
- cannot_find_file fill_help_tables.sql @pkgdata_locations@
- exit 1
- fi
- plugindir=`find_in_dirs --dir auth_pam.so $basedir/lib*/plugin $basedir/lib*/mysql/plugin $basedir/lib/*/mariadb19/plugin`
+ bindir="$basedir/@INSTALL_BINDIR@"
+ resolveip="$bindir/resolveip"
+ mysqld="$basedir/@INSTALL_SBINDIR@/mariadbd"
+ langdir="$basedir/sql/share/english"
+ srcpkgdatadir="$basedir/@INSTALL_MYSQLSHAREDIR@"
+ buildpkgdatadir="$basedir/@INSTALL_MYSQLSHAREDIR@"
+ plugindir="$basedir/@INSTALL_PLUGINDIR@"
pamtooldir=$plugindir
# relative from where the script was run for a relocatable install
(haven't tested it yet)