Details
-
Bug
-
Status: Open (View Workflow)
-
Major
-
Resolution: Unresolved
-
10.11, 11.4, 11.8, 12.3, 13.0, 13.1, 13.2
-
None
-
Can result in unexpected behaviour
Description
mariadbd-multi start checks every datadir= of a server group, not only the last one, which is the one the server uses. In the test case below, [mysqld2] is written twice in one option file: the first sets a datadir= that cannot be created, the second a valid one. mariadbd-multi stops with FATAL ERROR: Cannot create data directory on the first one, and the server is not started
Test case
BASEDIR=/test/MD301026-mariadb-13.2.0-linux-x86_64-opt |
TMPDIR=/tmp/testdir |
export HOME=$TMPDIR PATH=$BASEDIR/bin:$PATH |
unset MYSQL_HOME MARIADB_HOME |
mkdir -p $TMPDIR/itmp $TMPDIR/ro |
$BASEDIR/scripts/mariadb-install-db --no-defaults --basedir=$BASEDIR --datadir=$TMPDIR/d2 --tmpdir=$TMPDIR/itmp --auth-root-authentication-method=normal >/dev/null 2>&1 |
chmod 555 $TMPDIR/ro # a datadir location the user cannot write to |
cat > $TMPDIR/multi.cnf <<EOC |
[mysqld_multi]
|
mysqld=$BASEDIR/bin/mariadbd |
mysqladmin=$BASEDIR/bin/mariadb-admin |
user=root
|
[mysqld2]
|
datadir=$TMPDIR/ro/data2 |
[mysqld2]
|
datadir=$TMPDIR/d2 |
socket=$TMPDIR/s2 |
pid-file=$TMPDIR/p2 |
log-error=$TMPDIR/e2.err |
skip-networking
|
EOC
|
|
|
mariadbd-multi --defaults-file=$TMPDIR/multi.cnf --no-log --silent start 2; echo "exit code: $?"; sleep 5 |
[ -e $TMPDIR/p2 ] && echo "p2: server running" || echo "p2: no server" |
|
|
# Cleanup
|
mariadb-admin --no-defaults -uroot --socket=$TMPDIR/s2 shutdown >/dev/null 2>&1; sleep 3; chmod 755 $TMPDIR/ro; |
rm -rf $TMPDIR |
|
Script output:
mariadbd-multi log file version 3.0; run: Wed Nov 11 07:44:55 2026
|
|
|
Starting MariaDB servers
|
FATAL ERROR: Cannot create data directory /tmp/testdir/ro/data2: Permission denied
|
exit code: 1
|
p2: no server
|