From 3d5f508d038ae15f98277d4f5ac68bb0d1364320 Mon Sep 17 00:00:00 2001 From: Andrii Nikitin Date: Fri, 24 Nov 2023 16:33:19 +0100 Subject: [PATCH] Repalce mysql names with mariadb (depricated) --- product/ma/local/init_datadir.sh.m4 | 2 +- product/ma/local/sql.sh.m4 | 12 ++++++------ product/ma/local/start.sh.m4 | 9 +++++++-- product/ma/local/status.sh.m4 | 2 +- product/ma/local/stop.sh.m4 | 2 +- 5 files changed, 16 insertions(+), 11 deletions(-) diff --git a/product/ma/local/init_datadir.sh.m4 b/product/ma/local/init_datadir.sh.m4 index 58026f1..3d23719 100644 --- a/product/ma/local/init_datadir.sh.m4 +++ b/product/ma/local/init_datadir.sh.m4 @@ -3,4 +3,4 @@ set -e eatmydata=$(which eatmydata 2>/dev/null) || : -$eatmydata mysql_install_db --no-defaults --data=__datadir --log-error=__workdir/.install | head -n 10 +$eatmydata mariadb-install-db --no-defaults --data=__datadir --log-error=__workdir/.install | head -n 10 diff --git a/product/ma/local/sql.sh.m4 b/product/ma/local/sql.sh.m4 index 12ec174..9cb0771 100644 --- a/product/ma/local/sql.sh.m4 +++ b/product/ma/local/sql.sh.m4 @@ -1,22 +1,22 @@ if [[ $1 == -* ]] ; then -mysql --batch --socket=__workdir/.sock "$@" +mariadb --batch --socket=__workdir/.sock "$@" elif [ -z "$2" ]; then if [ "$(basename $0)" == sql ]; then if [ -f __workdir/default_db.cnf ] && [ "$#" == 1 ]; then - mysql "$(cat __workdir/default_db.cnf)" --batch --socket=__workdir/.sock -Ne "$*" + mariadb "$(cat __workdir/default_db.cnf)" --batch --socket=__workdir/.sock -Ne "$*" else - mysql --batch --socket=__workdir/.sock -Ne "$*" + mariadb --batch --socket=__workdir/.sock -Ne "$*" fi else db=${0#*_} if [ "$#" == 0 ]; then - mysql "$db" --socket=__workdir/.sock + mariadb "$db" --socket=__workdir/.sock else - mysql $db --socket=__workdir/.sock --batch -Ne "$@" + mariadb $db --socket=__workdir/.sock --batch -Ne "$@" fi fi else db=$1 shift -mysql "$db" --batch --socket=__workdir/.sock -Ne "$@" +mariadb "$db" --batch --socket=__workdir/.sock -Ne "$@" fi diff --git a/product/ma/local/start.sh.m4 b/product/ma/local/start.sh.m4 index 38f3d06..0efc341 100644 --- a/product/ma/local/start.sh.m4 +++ b/product/ma/local/start.sh.m4 @@ -4,6 +4,11 @@ set -e /usr/sbin/mariadbd --datadir=__datadir --user=$USER --socket=__workdir/.sock --skip-networking --log-error=__workdir/.cerr --pid-file=__workdir/.pid "$@" & -sleep 1 -__workdir/status >& /dev/null || sleep 1 +sleep 0.1 +__workdir/status >& /dev/null || sleep 0.1 +__workdir/status >& /dev/null || sleep 0.1 +__workdir/status >& /dev/null || sleep 0.1 +__workdir/status >& /dev/null || sleep 0.1 +__workdir/status >& /dev/null || sleep 0.1 +__workdir/status >& /dev/null || sleep 0.1 __workdir/status >& /dev/null || sleep 1 diff --git a/product/ma/local/status.sh.m4 b/product/ma/local/status.sh.m4 index 55b9593..6a366fc 100644 --- a/product/ma/local/status.sh.m4 +++ b/product/ma/local/status.sh.m4 @@ -1 +1 @@ -mysqladmin --socket=__workdir/.sock status +mariadbadmin --socket=__workdir/.sock status diff --git a/product/ma/local/stop.sh.m4 b/product/ma/local/stop.sh.m4 index 7590fc3..8b2f93e 100644 --- a/product/ma/local/stop.sh.m4 +++ b/product/ma/local/stop.sh.m4 @@ -1 +1 @@ -mysqladmin --socket=__workdir/.sock shutdown +mariadbadmin --socket=__workdir/.sock shutdown