Skip to content

Commit a6e2d7d

Browse files
authored
Merge pull request #340 from darioseidl/patch-1
Support starting with encrypt-tmp-files
2 parents 58bef41 + 0d197a9 commit a6e2d7d

File tree

6 files changed

+54
-12
lines changed

6 files changed

+54
-12
lines changed

10.1/docker-entrypoint.sh

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,15 @@ docker_process_init_files() {
7878
done
7979
}
8080

81+
# arguments necessary to run "mysqld --verbose --help" successfully (used for testing configuration validity and for extracting default/configured values)
82+
_verboseHelpArgs=(
83+
--verbose --help
84+
--log-bin-index="$(mktemp -u)" # https://github.com/docker-library/mysql/issues/136
85+
--encrypt-tmp-files=0 # https://github.com/docker-library/mariadb/issues/339
86+
)
87+
8188
mysql_check_config() {
82-
local toRun=( "$@" --verbose --help --log-bin-index="$(mktemp -u)" ) errors
89+
local toRun=( "$@" "${_verboseHelpArgs[@]}" ) errors
8390
if ! errors="$("${toRun[@]}" 2>&1 >/dev/null)"; then
8491
mysql_error $'mysqld failed while attempting to check config\n\tcommand was: '"${toRun[*]}"$'\n\t'"$errors"
8592
fi
@@ -90,7 +97,7 @@ mysql_check_config() {
9097
# latter only show values present in config files, and not server defaults
9198
mysql_get_config() {
9299
local conf="$1"; shift
93-
"$@" --verbose --help --log-bin-index="$(mktemp -u)" 2>/dev/null \
100+
"$@" "${_verboseHelpArgs[@]}" 2>/dev/null \
94101
| awk -v conf="$conf" '$1 == conf && /^[^ \t]/ { sub(/^[^ \t]+[ \t]+/, ""); print; exit }'
95102
# match "datadir /some/path with/spaces in/it here" but not "--xyz=abc\n datadir (xyz)"
96103
}

10.2/docker-entrypoint.sh

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,15 @@ docker_process_init_files() {
7878
done
7979
}
8080

81+
# arguments necessary to run "mysqld --verbose --help" successfully (used for testing configuration validity and for extracting default/configured values)
82+
_verboseHelpArgs=(
83+
--verbose --help
84+
--log-bin-index="$(mktemp -u)" # https://github.com/docker-library/mysql/issues/136
85+
--encrypt-tmp-files=0 # https://github.com/docker-library/mariadb/issues/339
86+
)
87+
8188
mysql_check_config() {
82-
local toRun=( "$@" --verbose --help --log-bin-index="$(mktemp -u)" ) errors
89+
local toRun=( "$@" "${_verboseHelpArgs[@]}" ) errors
8390
if ! errors="$("${toRun[@]}" 2>&1 >/dev/null)"; then
8491
mysql_error $'mysqld failed while attempting to check config\n\tcommand was: '"${toRun[*]}"$'\n\t'"$errors"
8592
fi
@@ -90,7 +97,7 @@ mysql_check_config() {
9097
# latter only show values present in config files, and not server defaults
9198
mysql_get_config() {
9299
local conf="$1"; shift
93-
"$@" --verbose --help --log-bin-index="$(mktemp -u)" 2>/dev/null \
100+
"$@" "${_verboseHelpArgs[@]}" 2>/dev/null \
94101
| awk -v conf="$conf" '$1 == conf && /^[^ \t]/ { sub(/^[^ \t]+[ \t]+/, ""); print; exit }'
95102
# match "datadir /some/path with/spaces in/it here" but not "--xyz=abc\n datadir (xyz)"
96103
}

10.3/docker-entrypoint.sh

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,15 @@ docker_process_init_files() {
7878
done
7979
}
8080

81+
# arguments necessary to run "mysqld --verbose --help" successfully (used for testing configuration validity and for extracting default/configured values)
82+
_verboseHelpArgs=(
83+
--verbose --help
84+
--log-bin-index="$(mktemp -u)" # https://github.com/docker-library/mysql/issues/136
85+
--encrypt-tmp-files=0 # https://github.com/docker-library/mariadb/issues/339
86+
)
87+
8188
mysql_check_config() {
82-
local toRun=( "$@" --verbose --help --log-bin-index="$(mktemp -u)" ) errors
89+
local toRun=( "$@" "${_verboseHelpArgs[@]}" ) errors
8390
if ! errors="$("${toRun[@]}" 2>&1 >/dev/null)"; then
8491
mysql_error $'mysqld failed while attempting to check config\n\tcommand was: '"${toRun[*]}"$'\n\t'"$errors"
8592
fi
@@ -90,7 +97,7 @@ mysql_check_config() {
9097
# latter only show values present in config files, and not server defaults
9198
mysql_get_config() {
9299
local conf="$1"; shift
93-
"$@" --verbose --help --log-bin-index="$(mktemp -u)" 2>/dev/null \
100+
"$@" "${_verboseHelpArgs[@]}" 2>/dev/null \
94101
| awk -v conf="$conf" '$1 == conf && /^[^ \t]/ { sub(/^[^ \t]+[ \t]+/, ""); print; exit }'
95102
# match "datadir /some/path with/spaces in/it here" but not "--xyz=abc\n datadir (xyz)"
96103
}

10.4/docker-entrypoint.sh

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,15 @@ docker_process_init_files() {
7878
done
7979
}
8080

81+
# arguments necessary to run "mysqld --verbose --help" successfully (used for testing configuration validity and for extracting default/configured values)
82+
_verboseHelpArgs=(
83+
--verbose --help
84+
--log-bin-index="$(mktemp -u)" # https://github.com/docker-library/mysql/issues/136
85+
--encrypt-tmp-files=0 # https://github.com/docker-library/mariadb/issues/339
86+
)
87+
8188
mysql_check_config() {
82-
local toRun=( "$@" --verbose --help --log-bin-index="$(mktemp -u)" ) errors
89+
local toRun=( "$@" "${_verboseHelpArgs[@]}" ) errors
8390
if ! errors="$("${toRun[@]}" 2>&1 >/dev/null)"; then
8491
mysql_error $'mysqld failed while attempting to check config\n\tcommand was: '"${toRun[*]}"$'\n\t'"$errors"
8592
fi
@@ -90,7 +97,7 @@ mysql_check_config() {
9097
# latter only show values present in config files, and not server defaults
9198
mysql_get_config() {
9299
local conf="$1"; shift
93-
"$@" --verbose --help --log-bin-index="$(mktemp -u)" 2>/dev/null \
100+
"$@" "${_verboseHelpArgs[@]}" 2>/dev/null \
94101
| awk -v conf="$conf" '$1 == conf && /^[^ \t]/ { sub(/^[^ \t]+[ \t]+/, ""); print; exit }'
95102
# match "datadir /some/path with/spaces in/it here" but not "--xyz=abc\n datadir (xyz)"
96103
}

10.5/docker-entrypoint.sh

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,15 @@ docker_process_init_files() {
7878
done
7979
}
8080

81+
# arguments necessary to run "mysqld --verbose --help" successfully (used for testing configuration validity and for extracting default/configured values)
82+
_verboseHelpArgs=(
83+
--verbose --help
84+
--log-bin-index="$(mktemp -u)" # https://github.com/docker-library/mysql/issues/136
85+
--encrypt-tmp-files=0 # https://github.com/docker-library/mariadb/issues/339
86+
)
87+
8188
mysql_check_config() {
82-
local toRun=( "$@" --verbose --help --log-bin-index="$(mktemp -u)" ) errors
89+
local toRun=( "$@" "${_verboseHelpArgs[@]}" ) errors
8390
if ! errors="$("${toRun[@]}" 2>&1 >/dev/null)"; then
8491
mysql_error $'mysqld failed while attempting to check config\n\tcommand was: '"${toRun[*]}"$'\n\t'"$errors"
8592
fi
@@ -90,7 +97,7 @@ mysql_check_config() {
9097
# latter only show values present in config files, and not server defaults
9198
mysql_get_config() {
9299
local conf="$1"; shift
93-
"$@" --verbose --help --log-bin-index="$(mktemp -u)" 2>/dev/null \
100+
"$@" "${_verboseHelpArgs[@]}" 2>/dev/null \
94101
| awk -v conf="$conf" '$1 == conf && /^[^ \t]/ { sub(/^[^ \t]+[ \t]+/, ""); print; exit }'
95102
# match "datadir /some/path with/spaces in/it here" but not "--xyz=abc\n datadir (xyz)"
96103
}

docker-entrypoint.sh

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,15 @@ docker_process_init_files() {
7878
done
7979
}
8080

81+
# arguments necessary to run "mysqld --verbose --help" successfully (used for testing configuration validity and for extracting default/configured values)
82+
_verboseHelpArgs=(
83+
--verbose --help
84+
--log-bin-index="$(mktemp -u)" # https://github.com/docker-library/mysql/issues/136
85+
--encrypt-tmp-files=0 # https://github.com/docker-library/mariadb/issues/339
86+
)
87+
8188
mysql_check_config() {
82-
local toRun=( "$@" --verbose --help --log-bin-index="$(mktemp -u)" ) errors
89+
local toRun=( "$@" "${_verboseHelpArgs[@]}" ) errors
8390
if ! errors="$("${toRun[@]}" 2>&1 >/dev/null)"; then
8491
mysql_error $'mysqld failed while attempting to check config\n\tcommand was: '"${toRun[*]}"$'\n\t'"$errors"
8592
fi
@@ -90,7 +97,7 @@ mysql_check_config() {
9097
# latter only show values present in config files, and not server defaults
9198
mysql_get_config() {
9299
local conf="$1"; shift
93-
"$@" --verbose --help --log-bin-index="$(mktemp -u)" 2>/dev/null \
100+
"$@" "${_verboseHelpArgs[@]}" 2>/dev/null \
94101
| awk -v conf="$conf" '$1 == conf && /^[^ \t]/ { sub(/^[^ \t]+[ \t]+/, ""); print; exit }'
95102
# match "datadir /some/path with/spaces in/it here" but not "--xyz=abc\n datadir (xyz)"
96103
}

0 commit comments

Comments
 (0)