From: Ismaƫl Bouya Date: Wed, 13 Oct 2021 00:24:38 +0000 (+0200) Subject: Fix mariadb replication X-Git-Url: https://git.immae.eu/?a=commitdiff_plain;h=fd7935cf5ae343386c2243cd6bc7fbf52ba4ac65;p=perso%2FImmae%2FConfig%2FNix.git Fix mariadb replication It adds the pam soname at install which is missing at first dump. --- diff --git a/modules/private/databases/mariadb_replication.nix b/modules/private/databases/mariadb_replication.nix index 5a5a8b0..b89c764 100644 --- a/modules/private/databases/mariadb_replication.nix +++ b/modules/private/databases/mariadb_replication.nix @@ -192,15 +192,17 @@ in preStart = '' if ! test -e ${dataDir}/mysql; then - ${hcfg.package}/bin/mysqldump \ - --defaults-file=${config.secrets.location}/mysql_replication/${name}/mysqldump_remote \ - -h ${hcfg.host} \ - -P ${hcfg.port} \ - --ssl \ - --gtid \ - --flush-privileges \ - --master-data \ - --all-databases > ${dataDir}/initial.sql + if ! test -e ${dataDir}/initial.sql; then + ${hcfg.package}/bin/mysqldump \ + --defaults-file=${config.secrets.location}/mysql_replication/${name}/mysqldump_remote \ + -h ${hcfg.host} \ + -P ${hcfg.port} \ + --ssl \ + --gtid \ + --flush-privileges \ + --master-data \ + --all-databases > ${dataDir}/initial.sql + fi ${hcfg.package}/bin/mysql_install_db \ --defaults-file=/etc/mysql/${name}_my.cnf \ @@ -224,6 +226,7 @@ in let sql_before = pkgs.writeText "mysql-initial-before" '' DROP DATABASE test; + INSTALL SONAME 'auth_pam'; ''; setupScript = pkgs.writeScript "mysql-setup" '' #!${pkgs.runtimeShell} -e