diff --git a/Dockerfile b/Dockerfile index aed71d0..024a101 100644 --- a/Dockerfile +++ b/Dockerfile @@ -30,6 +30,7 @@ LABEL org.opencontainers.image.url="https://www.opensuse.org" LABEL org.opencontainers.image.created="%BUILDTIME%" LABEL org.opencontainers.image.vendor="openSUSE Project" LABEL org.opencontainers.image.source="%SOURCEURL%" +LABEL org.opencontainers.image.ref.name="11.4-%RELEASE%" LABEL org.opensuse.reference="registry.opensuse.org/opensuse/mariadb:11.4-%RELEASE%" LABEL org.openbuildservice.disturl="%DISTURL%" LABEL org.opensuse.lifecycle-url="https://en.opensuse.org/Lifetime#openSUSE_BCI" diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index 6d2fa4f..7ef1164 100644 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -206,9 +206,11 @@ docker_create_db_directories() { if [ "$user" = "0" ]; then # this will cause less disk access than `chown -R` - find "$DATADIR" \! -user mysql -exec chown mysql: '{}' + + find "$DATADIR" \! -user mysql \( -exec chown mysql: '{}' + -o -true \) # See https://github.com/MariaDB/mariadb-docker/issues/363 - find "${SOCKET%/*}" -maxdepth 0 \! -user mysql -exec chown mysql: '{}' \; + if [ "${SOCKET:0:1}" != '@' ]; then # not abstract sockets + find "${SOCKET%/*}" -maxdepth 0 \! -user mysql \( -exec chown mysql: '{}' \; -o -true \) + fi # memory.pressure local cgroup; cgroup=$( "$DATADIR"/.my-healthcheck.cnf + echo -e "[mariadb-client]\\nport=$PORT\\nsocket=$SOCKET\\nuser=healthcheck\\npassword=$healthCheckConnectPass\\n" > "$DATADIR"/.my-healthcheck.cnf $maskPreserve } @@ -528,7 +530,7 @@ docker_mariadb_init() rm -rf "$DATADIR"/.init "$DATADIR"/.restore if [ "$(id -u)" = "0" ]; then # this will cause less disk access than `chown -R` - find "$DATADIR" \! -user mysql -exec chown mysql: '{}' + + find "$DATADIR" \! -user mysql \( -exec chown mysql: '{}' + -o -true \) fi done if _check_if_upgrade_is_needed; then diff --git a/healthcheck.sh b/healthcheck.sh index 8355eca..b049899 100644 --- a/healthcheck.sh +++ b/healthcheck.sh @@ -10,8 +10,8 @@ # the --replication option. This allows a different set of replication checks # on different connections. # -# --su{=|-mariadb} is option to run the healthcheck as a different unix user. -# Useful if mariadb@localhost user exists with unix socket authentication +# --su{=|-mysql} is option to run the healthcheck as a different unix user. +# Useful if mysql@localhost user exists with unix socket authentication # Using this option disregards previous options set, so should usually be the # first option. # @@ -32,7 +32,7 @@ # different from elsewhere. # # Note * though denied error message will result in error log without -# any permissions. +# any permissions. USAGE recommend to avoid this. set -eo pipefail @@ -43,6 +43,7 @@ _process_sql() ${def['extra_file']:+--defaults-extra-file=${def['extra_file']}} \ ${def['group_suffix']:+--defaults-group-suffix=${def['group_suffix']}} \ --skip-ssl --skip-ssl-verify-server-cert \ + --protocol socket \ -B "$@" } @@ -56,6 +57,16 @@ _process_sql() # isn't tested. connect() { + local s + # short cut mechanism, to work with --require-secure-transport + s=$(_process_sql --skip-column-names -e 'select @@skip_networking') + case "$s" in + 0|1) + connect_s=$s + return "$s"; + ;; + esac + # falling back to this if there wasn't a connection answer. set +e +o pipefail # (on second extra_file) # shellcheck disable=SC2086 @@ -70,9 +81,11 @@ connect() set -eo pipefail if (( "$ret" == 0 )); then # grep Matched "Can't connect" so we fail - return 1 + connect_s=1 + else + connect_s=0 fi - return 0 + return $connect_s } # INNODB_INITIALIZED @@ -227,6 +240,7 @@ fi declare -A repl declare -A def nodefaults= +connect_s= datadir=/var/lib/mysql if [ -f $datadir/.my-healthcheck.cnf ]; then def['extra_file']=$datadir/.my-healthcheck.cnf @@ -353,3 +367,9 @@ while [ $# -gt 0 ]; do fi shift done +if [ -z "$connect_s" ]; then + # we didn't do a connnect test, so the current success status is suspicious + # return what connect thinks. + connect + exit $? +fi diff --git a/mariadb-image.changes b/mariadb-image.changes index ef35cdf..010d35c 100644 --- a/mariadb-image.changes +++ b/mariadb-image.changes @@ -1,3 +1,13 @@ +------------------------------------------------------------------- +Fri Aug 9 08:05:26 UTC 2024 - Dirk Mueller + +- update entry point scripts from git + +------------------------------------------------------------------- +Thu Aug 8 19:28:10 UTC 2024 - Dirk Mueller + +- add oci.image.ref.name + ------------------------------------------------------------------- Thu Aug 8 16:48:44 UTC 2024 - Dirk Mueller