diff --git a/features/src/mariadb/devcontainer-feature.json b/features/src/mariadb/devcontainer-feature.json index cf12c7b0..a757aee0 100644 --- a/features/src/mariadb/devcontainer-feature.json +++ b/features/src/mariadb/devcontainer-feature.json @@ -1,7 +1,7 @@ { "name": "MariaDB", "id": "mariadb", - "version": "1.4.0", + "version": "1.4.1", "description": "Sets up MariaDB into the Dev Environment", "options": { "installDatabaseToWorkspaces": { diff --git a/features/src/mariadb/entrypoint.alpine.tpl b/features/src/mariadb/entrypoint.alpine.tpl index 9308ad9d..cbea5d26 100755 --- a/features/src/mariadb/entrypoint.alpine.tpl +++ b/features/src/mariadb/entrypoint.alpine.tpl @@ -12,13 +12,13 @@ chown -R "${MARIADB_USER}:${MARIADB_USER}" "${MARIADB_DATADIR}" install -d /run/mysqld -o "${MARIADB_USER}" -g "${MARIADB_USER}" if [ ! -d "${MARIADB_DATADIR}/mysql" ]; then - mysql_install_db --auth-root-authentication-method=normal --skip-test-db --user="${MARIADB_USER}" --datadir="${MARIADB_DATADIR}" + mariadb-install-db --auth-root-authentication-method=normal --skip-test-db --user="${MARIADB_USER}" --datadir="${MARIADB_DATADIR}" fi if [ -x /sbin/chpst ]; then # shellcheck disable=SC2086,SC2154 # there could be multiple options in EXTRA_OPTIONS exec chpst -u "${MARIADB_USER}:${MARIADB_USER}" \ - mysqld \ + mariadbd \ --datadir="${MARIADB_DATADIR}" \ --sql-mode=ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION \ --max_allowed_packet=67M \ @@ -27,7 +27,7 @@ if [ -x /sbin/chpst ]; then else # shellcheck disable=SC2086 # there could be multiple options in EXTRA_OPTIONS exec su-exec "${MARIADB_USER}:${MARIADB_USER}" \ - mysqld \ + mariadbd \ --datadir="${MARIADB_DATADIR}" \ --sql-mode=ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION \ --max_allowed_packet=67M \ diff --git a/features/src/mariadb/entrypoint.deb.tpl b/features/src/mariadb/entrypoint.deb.tpl index 60235851..3ff14b5a 100755 --- a/features/src/mariadb/entrypoint.deb.tpl +++ b/features/src/mariadb/entrypoint.deb.tpl @@ -12,7 +12,7 @@ chown -R "${MARIADB_USER}:${MARIADB_USER}" "${MARIADB_DATADIR}" install -d /run/mysqld -o "${MARIADB_USER}" -g "${MARIADB_USER}" if [ ! -d "${MARIADB_DATADIR}/mysql" ]; then - mysql_install_db --auth-root-authentication-method=normal --skip-test-db --user="${MARIADB_USER}" --datadir="${MARIADB_DATADIR}" + mariadb-install-db --auth-root-authentication-method=normal --skip-test-db --user="${MARIADB_USER}" --datadir="${MARIADB_DATADIR}" fi MY_UID="$(id -u "${MARIADB_USER}")" @@ -20,7 +20,7 @@ MY_GID="$(id -g "${MARIADB_USER}")" # shellcheck disable=SC2086,SC2154 # there could be multiple options in EXTRA_OPTIONS exec setpriv --reuid="${MY_UID}" --regid="${MY_GID}" --inh-caps=-all --init-groups \ - mysqld \ + mariadbd \ --datadir="${MARIADB_DATADIR}" \ --sql-mode=ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION \ --max_allowed_packet=67M \ diff --git a/features/src/mariadb/service-run.tpl b/features/src/mariadb/service-run.tpl index d1c53c72..9cb99e94 100755 --- a/features/src/mariadb/service-run.tpl +++ b/features/src/mariadb/service-run.tpl @@ -12,12 +12,12 @@ chown -R "${MARIADB_USER}:${MARIADB_USER}" "${MARIADB_DATADIR}" install -d /run/mysqld -o "${MARIADB_USER}" -g "${MARIADB_USER}" if [ ! -d "${MARIADB_DATADIR}/mysql" ]; then - mysql_install_db --auth-root-authentication-method=normal --skip-test-db --user="${MARIADB_USER}" --datadir="${MARIADB_DATADIR}" + mariadb-install-db --auth-root-authentication-method=normal --skip-test-db --user="${MARIADB_USER}" --datadir="${MARIADB_DATADIR}" fi # shellcheck disable=SC2086,SC2154 # there could be multiple options in EXTRA_OPTIONS exec chpst -u "${MARIADB_USER}:${MARIADB_USER}" \ - mysqld \ + mariadbd \ --datadir="${MARIADB_DATADIR}" \ --sql-mode=ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION \ --max_allowed_packet=67M \ diff --git a/features/test/mariadb/checks.sh b/features/test/mariadb/checks.sh index 0453255e..e754178e 100755 --- a/features/test/mariadb/checks.sh +++ b/features/test/mariadb/checks.sh @@ -1,6 +1,13 @@ #!/bin/bash -if hash sv >/dev/null 2>&1; then +second=0 +while ! mariadb-admin ping -u root -h 127.0.0.1 --silent && [[ "${second}" -lt 60 ]]; do + sleep 1 + second=$((second + 1)) +done +check "MariaDB is online" mariadb-admin ping -u root -h 127.0.0.1 --silent + +if hash sv > /dev/null 2>&1; then check "mariadb is running" sudo sh -c 'sv status mariadb | grep -E ^run:' sudo sv stop mariadb check "mariadb is stopped" sudo sh -c 'sv status mariadb | grep -E ^down:' @@ -9,13 +16,6 @@ else check "mariadb is running" pgrep mariadbd fi -second=0 -while ! mysqladmin ping -u root -h 127.0.0.1 --silent && [[ "${second}" -lt 60 ]]; do - sleep 1 - second=$((second+1)) -done -check "MariaDB is online" mysqladmin ping -u root -h 127.0.0.1 --silent - # Microsoft's base images contain zsh. We don't want to run this check for MS images because we have no control over the installed services. if test -d /etc/rc2.d && ! test -e /usr/bin/zsh; then dir="$(ls -1 /etc/rc2.d)"