Skip to content

Commit 2b7a420

Browse files
committed
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').
1 parent ea6b459 commit 2b7a420

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

plugins/mariadb/process-compose.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ version: "0.5"
22

33
processes:
44
mariadb:
5-
command: "mysqld --log-error=$MYSQL_HOME/mysql.log & MYSQL_PID=$! && echo 'Starting mysqld... check mariadb_logs for details'"
6-
is_daemon: true
5+
command: "echo 'Starting mysqld... check mariadb_logs for details'; mysqld --log-error=$MYSQL_HOME/mysql.log"
6+
is_daemon: false
77
shutdown:
88
command: "mysqladmin -u root shutdown"
99
availability:

0 commit comments

Comments
 (0)