From c18e41528023fc63ec685d41ad1cb593eb237b75 Mon Sep 17 00:00:00 2001 From: Daniel Hilst <392820+dhilst@users.noreply.github.com> Date: Wed, 14 Oct 2026 18:49:02 -0300 Subject: [PATCH] fix(xcat-core): mysqlsetup cannot find a configuration file to rewrite The candidate list of comment_bind_address was assigned by a top-level statement below the main flow's exit, so the statement never ran. The list was empty, the fallback index read undef, and mysqlsetup -i failed with "cannot read : No such file or directory" on every MySQL cluster. The service node install stops there. A BEGIN block now fills the list at compile time. Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com> --- xCAT-client/bin/mysqlsetup | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/xCAT-client/bin/mysqlsetup b/xCAT-client/bin/mysqlsetup index 2bb15dcd65..0091ced6b3 100755 --- a/xCAT-client/bin/mysqlsetup +++ b/xCAT-client/bin/mysqlsetup @@ -791,11 +791,17 @@ sub fixinstalldir # The candidate configuration files, in the order mysqlsetup reads them. On # Ubuntu 16.04 the bind-address line is in mariadb.conf.d/50-server.cnf, and on # SLE15 it is in /etc/my.cnf. The last one is the fallback. -our @BIND_FILES = ( - "/etc/mysql/mariadb.conf.d/50-server.cnf", - "/etc/mysql/my.cnf", - "/etc/my.cnf", -); +# BEGIN, because the main flow exits above this line: a plain assignment here +# never runs, and the list is empty when comment_bind_address reads it. +our @BIND_FILES; + +BEGIN { + @BIND_FILES = ( + "/etc/mysql/mariadb.conf.d/50-server.cnf", + "/etc/mysql/my.cnf", + "/etc/my.cnf", + ); +} sub comment_bind_address {