itiligent / Guacamole-Installer

Automated install of Gucamole with options for HTTPS reverse proxy, Active Directory integration, MFA, LetsEncrypt, dark theme, MySQL backup, email alerts & more.
GNU Affero General Public License v3.0
240 stars 44 forks source link

Apply tzinfo before restarting MySQL service #13

Closed eduardomozart closed 1 year ago

eduardomozart commented 1 year ago

By default, if timezone isn't set, MariaDB attempts to parse it from system locale, as can be seen here: https://mariadb.com/kb/en/time-zones/

So the parameter default_time_zone is set at /etc/mysql/mariadb.conf.d/50-server.conf on Debian 12 to the system timezone, but the script fails on Restarting MySQL service & enable at boot... stage because it's timezone info wasn't set on database yet and the MariaDB daemon fails to start.

The following error is thrown on MariaDB logs when attempting to restart MariaDB service without importing the timezone first:

unifi@unifi:/etc/mysql/mariadb.conf.d$ sudo journalctl -xeu mariadb.service
ago 09 13:33:16 unifi mariadbd[73176]: 2023-08-09 13:33:16 0 [Note] Server socket created on IP: '127.0.0.1'.
ago 09 13:33:16 unifi mariadbd[73176]: 2023-08-09 13:33:16 0 [ERROR] Fatal error: Illegal or unknown default time zone 'America/Sao_Paulo'