my_print_defaults --defaults-extra-file=/etc/mynode1.cnf doesn't read the extra file starting form version 10.5. The extra file contains the datadir; the output from my_print_defaults is used by the SUSE script mysql-systemd-helper. Missing datadir, this script will run mysql_install_db on a fallback directory, causing errors when mariadb is started.
I have tested this on mariadb version 10.5.10 and 10.6.4 on Tumbleweed and version 10.5.11 on SUSE Linux Enterprise Server 15 SP3.
To test I have created a file /etc/mynode1.cnf:
port = 3310
datadir = /var/lib/mysql/node1/databases
pid-file = /var/lib/mysql/node1/databases/mysqld.pid
socket = /run/mysql/node1mysql.sock
log-error = /var/log/mysql/node1/mysqld.log
secure_file_priv = /var/lib/mysql-files
Then run the following command:
/usr/bin/my_print_defaults mysqld mysqld_multi "node1" --defaults-file=/etc/mynode1.cnf
On mariadb 10.4 my_print_defaults print the following output:
// default options, left out
On newer version, starting from 10.5, the options from the extra files are left out.
I have read the diff for mysys/my_default.c between branch 10.4 and branch 10.5, it seems to me that it has been completely rewritten. The "Upgrading from 10.4 to 10.5" page doesn't refer this change, so this could potentially be a newly introduced bug.