refactor(entrypt): Use new executable names

Version 11 renames classic 'mysql' executable commands to 'mariadb' branded ones.
This commit is contained in:
Asif Bacchus 2025-01-24 01:47:52 -07:00
parent 4c98e019de
commit 8a6df0d489

View File

@ -86,7 +86,7 @@ if [ -z "$(ls -A /var/lib/mysql/ 2> /dev/null)" ]; then
# create system tables # create system tables
printf "DB-CREATE: Setting up mySQL system tables\n" printf "DB-CREATE: Setting up mySQL system tables\n"
if (! mysql_install_db --user=mysql --ldata=/var/lib/mysql > /dev/null); then if (! mariadb-install-db --user=mysql --ldata=/var/lib/mysql > /dev/null); then
exit 1 exit 1
fi fi
@ -113,7 +113,7 @@ if [ -z "$(ls -A /var/lib/mysql/ 2> /dev/null)" ]; then
# execute statements against mariadb and cleanup # execute statements against mariadb and cleanup
printf "DB-CREATE: Bootstrapping mySQL database\n" printf "DB-CREATE: Bootstrapping mySQL database\n"
if (! mysqld --user=mysql --bootstrap --verbose=0 --skip-name-resolve --skip-networking=0 < "$sqlCmd"); then if (! mariadbd --user=mysql --bootstrap --verbose=0 --skip-name-resolve --skip-networking=0 < "$sqlCmd"); then
exit 1 exit 1
fi fi
shred -u "$sqlCmd" shred -u "$sqlCmd"
@ -129,7 +129,7 @@ for f in /docker-entrypoint-initdb.d/*; do
*.sql) *.sql)
if [ -s "$f" ]; then if [ -s "$f" ]; then
printf "IMPORT-SQL: Importing %s\n" "$f" printf "IMPORT-SQL: Importing %s\n" "$f"
if (! mysqld --user=mysql --bootstrap --verbose=0 --skip-name-resolve --skip-networking=0 < "$f"); then if (! mariadbd --user=mysql --bootstrap --verbose=0 --skip-name-resolve --skip-networking=0 < "$f"); then
exit 3 exit 3
fi fi
printf "\n" printf "\n"
@ -138,7 +138,7 @@ for f in /docker-entrypoint-initdb.d/*; do
*.sql.gz) *.sql.gz)
if [ -s "$f" ]; then if [ -s "$f" ]; then
printf "IMPORT-SQL: Importing %s\n" "$f" printf "IMPORT-SQL: Importing %s\n" "$f"
if (! gunzip -c "$f" | mysqld --user=mysql --bootstrap --verbose=0 --skip-name-resolve --skip-networking=0); then if (! gunzip -c "$f" | mariadbd --user=mysql --bootstrap --verbose=0 --skip-name-resolve --skip-networking=0); then
exit 3 exit 3
fi fi
printf "\n" printf "\n"
@ -168,8 +168,8 @@ fi
# process CMD sent to this container # process CMD sent to this container
case "$1" in case "$1" in
-*) -*)
# param starts with '-' --> assume mysqld parameter(s) and append to CMD # param starts with '-' --> assume mariadbd parameter(s) and append to CMD
set -- /usr/bin/mysqld --user=mysql --console "$@" set -- /usr/bin/mariadbd --user=mysql --console "$@"
printf "\nExecuting: %s\n" "$*" printf "\nExecuting: %s\n" "$*"
exec "$@" exec "$@"
;; ;;