[MySQL, PHP, DockerAPI] Move mysql_tzinfo_to_sql trigger to php-fpm-mailcow to prevent race condition on slow disks (known bug @ MariaDB)
parent
b9aa1bf372
commit
6565e994bb
|
@ -230,6 +230,14 @@ class container_post(Resource):
|
|||
else:
|
||||
return jsonify(type='error', msg='mysql_upgrade: error running command', text=sql_return.output.decode('utf-8'))
|
||||
|
||||
# api call: container_post - post_action: exec - cmd: system - task: mysql_tzinfo_to_sql
|
||||
def container_post__exec__system__mysql_tzinfo_to_sql(self, container_id):
|
||||
for container in docker_client.containers.list(filters={"id": container_id}):
|
||||
sql_return = container.exec_run(["/bin/bash", "-c", "/usr/bin/mysql_tzinfo_to_sql /usr/share/zoneinfo | /bin/sed 's/Local time zone must be set--see zic manual page/FCTY/' | /usr/bin/mysql -uroot -p'" + os.environ['DBROOT'].replace("'", "'\\''") + "' mysql \n"], user='mysql')
|
||||
if sql_return.exit_code == 0:
|
||||
return jsonify(type='info', msg='mysql_tzinfo_to_sql: command completed successfully', text=sql_return.output.decode('utf-8'))
|
||||
else:
|
||||
return jsonify(type='error', msg='mysql_tzinfo_to_sql: error running command', text=sql_return.output.decode('utf-8'))
|
||||
|
||||
# api call: container_post - post_action: exec - cmd: reload - task: dovecot
|
||||
def container_post__exec__reload__dovecot(self, container_id):
|
||||
|
|
|
@ -25,7 +25,7 @@ if [[ -z $(redis-cli --raw -h redis-mailcow GET Q_MAX_AGE) ]]; then
|
|||
redis-cli --raw -h redis-mailcow SET Q_MAX_AGE 365
|
||||
fi
|
||||
|
||||
# Check of mysql_upgrade
|
||||
# Check mysql_upgrade
|
||||
|
||||
CONTAINER_ID=
|
||||
until [[ ! -z "${CONTAINER_ID}" ]] && [[ "${CONTAINER_ID}" =~ ^[[:alnum:]]*$ ]]; do
|
||||
|
@ -75,6 +75,11 @@ if [ ${SQL_CHANGED} -eq 1 ]; then
|
|||
fi
|
||||
fi
|
||||
|
||||
# Check mysql tz import
|
||||
SQL_FULL_TZINFO_IMPORT_RETURN=$(curl --silent --insecure -XPOST https://dockerapi/containers/${CONTAINER_ID}/exec -d '{"cmd":"system", "task":"mysql_tzinfo_to_sql"}' --silent -H 'Content-type: application/json')
|
||||
echo "MySQL mysql_tzinfo_to_sql - debug output:"
|
||||
echo ${SQL_FULL_TZINFO_IMPORT_RETURN}
|
||||
|
||||
# Trigger db init
|
||||
echo "Running DB init..."
|
||||
php -c /usr/local/etc/php -f /web/inc/init_db.inc.php
|
||||
|
|
|
@ -30,7 +30,7 @@ services:
|
|||
- MYSQL_DATABASE=${DBNAME}
|
||||
- MYSQL_USER=${DBUSER}
|
||||
- MYSQL_PASSWORD=${DBPASS}
|
||||
# - MYSQL_INITDB_SKIP_TZINFO=1
|
||||
- MYSQL_INITDB_SKIP_TZINFO=1
|
||||
restart: always
|
||||
ports:
|
||||
- "${SQL_PORT:-127.0.0.1:13306}:3306"
|
||||
|
@ -97,7 +97,7 @@ services:
|
|||
- rspamd
|
||||
|
||||
php-fpm-mailcow:
|
||||
image: mailcow/phpfpm:1.52
|
||||
image: mailcow/phpfpm:1.53
|
||||
build: ./data/Dockerfiles/phpfpm
|
||||
command: "php-fpm -d date.timezone=${TZ} -d expose_php=0"
|
||||
depends_on:
|
||||
|
@ -401,7 +401,7 @@ services:
|
|||
- watchdog
|
||||
|
||||
dockerapi-mailcow:
|
||||
image: mailcow/dockerapi:1.35
|
||||
image: mailcow/dockerapi:1.36
|
||||
restart: always
|
||||
build: ./data/Dockerfiles/dockerapi
|
||||
oom_kill_disable: true
|
||||
|
|
Loading…
Reference in New Issue