fix: load host mysql overrides after package defaults
This commit is contained in:
parent
c7135b988f
commit
4caf6be0a0
@ -7,8 +7,9 @@ if [[ $EUID -ne 0 || $# -ne 1 ]]; then
|
||||
fi
|
||||
|
||||
config_file=$(realpath "$1")
|
||||
config_target=/etc/mysql/mysql.conf.d/99-mes-prd.cnf
|
||||
config_candidate=/etc/mysql/mysql.conf.d/.99-mes-prd.cnf.candidate
|
||||
config_target=/etc/mysql/mysql.conf.d/zz-mes-prd.cnf
|
||||
config_candidate=/etc/mysql/mysql.conf.d/.zz-mes-prd.cnf.candidate
|
||||
legacy_config=/etc/mysql/mysql.conf.d/99-mes-prd.cnf
|
||||
if [[ ! -s $config_file ]]; then
|
||||
echo "config file is missing or empty: $config_file" >&2
|
||||
exit 2
|
||||
@ -25,6 +26,9 @@ mysqld --defaults-file="$config_candidate" --validate-config
|
||||
if [[ -e $config_target ]]; then
|
||||
unlink "$config_target"
|
||||
fi
|
||||
if [[ -e $legacy_config ]]; then
|
||||
unlink "$legacy_config"
|
||||
fi
|
||||
mv "$config_candidate" "$config_target"
|
||||
trap - EXIT
|
||||
systemctl restart mysql
|
||||
|
||||
@ -7,7 +7,7 @@ if [[ $EUID -ne 0 || $# -ne 1 ]]; then
|
||||
fi
|
||||
|
||||
config_file=$(realpath "$1")
|
||||
config_target=/etc/mysql/mysql.conf.d/99-mes-prd.cnf
|
||||
config_target=/etc/mysql/mysql.conf.d/zz-mes-prd.cnf
|
||||
if [[ ! -s $config_file ]]; then
|
||||
echo "config file is missing or empty: $config_file" >&2
|
||||
exit 2
|
||||
|
||||
Loading…
Reference in New Issue
Block a user