From ea6b4594b4682890e348391fbafa300a906e41e9 Mon Sep 17 00:00:00 2001 From: Jeff Turner Date: Mon, 17 Feb 2025 14:34:08 +1100 Subject: [PATCH 1/2] Expose the real mysqld exit code to process-compose, so it can report any errors. As a side-effect, removes $MYSQL_PID. Fixes #2518. The old code used shell '&' to background mysqld, then captured its pid with MYSQL_PID=$!, in doing so obscuring the mysqld exit code. I can't see any sane way of both propagating the exit code *and* setting MYSQL_PID. I also can't see any point in MYSQL_PID, given that process-compose is a TUI and the pid is readily available in $MYSQL_PID_FILE. So to fix the bug, I've made mysqld no longer backgrounded (is_daemon becomes 'false'). --- plugins/mysql/process-compose.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/mysql/process-compose.yaml b/plugins/mysql/process-compose.yaml index 9978c93f6b8..afce2fe79b7 100644 --- a/plugins/mysql/process-compose.yaml +++ b/plugins/mysql/process-compose.yaml @@ -2,8 +2,8 @@ version: "0.5" processes: mysql: - command: "mysqld --log-error=$MYSQL_HOME/mysql.log & MYSQL_PID=$! && echo 'Starting mysqld... check mysql_logs for details'" - is_daemon: true + command: "echo 'Starting mysqld... check mysql_logs for details'; mysqld --log-error=$MYSQL_HOME/mysql.log" + is_daemon: false shutdown: command: "mysqladmin -u root shutdown" availability: From 2b7a4206ac6e0567d92076eda95b4fdaab46e84c Mon Sep 17 00:00:00 2001 From: Jeff Turner Date: Mon, 17 Feb 2025 14:34:08 +1100 Subject: [PATCH 2/2] Expose the real mysqld exit code to process-compose, so it can report any errors. As a side-effect, removes $MYSQL_PID. Fixes #2518. The old code used shell '&' to background mysqld, then captured its pid with MYSQL_PID=$!, in doing so obscuring the mysqld exit code. I can't see any sane way of both propagating the exit code *and* setting MYSQL_PID. I also can't see any point in MYSQL_PID, given that process-compose is a TUI and the pid is readily available in $MYSQL_PID_FILE. So to fix the bug, I've made mysqld no longer backgrounded (is_daemon becomes 'false'). --- plugins/mariadb/process-compose.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/mariadb/process-compose.yaml b/plugins/mariadb/process-compose.yaml index ae1f7ad0973..d8d78556340 100644 --- a/plugins/mariadb/process-compose.yaml +++ b/plugins/mariadb/process-compose.yaml @@ -2,8 +2,8 @@ version: "0.5" processes: mariadb: - command: "mysqld --log-error=$MYSQL_HOME/mysql.log & MYSQL_PID=$! && echo 'Starting mysqld... check mariadb_logs for details'" - is_daemon: true + command: "echo 'Starting mysqld... check mariadb_logs for details'; mysqld --log-error=$MYSQL_HOME/mysql.log" + is_daemon: false shutdown: command: "mysqladmin -u root shutdown" availability: