aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--modules/private/databases/mariadb_replication.nix21
1 files changed, 12 insertions, 9 deletions
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
192 192
193 preStart = '' 193 preStart = ''
194 if ! test -e ${dataDir}/mysql; then 194 if ! test -e ${dataDir}/mysql; then
195 ${hcfg.package}/bin/mysqldump \ 195 if ! test -e ${dataDir}/initial.sql; then
196 --defaults-file=${config.secrets.location}/mysql_replication/${name}/mysqldump_remote \ 196 ${hcfg.package}/bin/mysqldump \
197 -h ${hcfg.host} \ 197 --defaults-file=${config.secrets.location}/mysql_replication/${name}/mysqldump_remote \
198 -P ${hcfg.port} \ 198 -h ${hcfg.host} \
199 --ssl \ 199 -P ${hcfg.port} \
200 --gtid \ 200 --ssl \
201 --flush-privileges \ 201 --gtid \
202 --master-data \ 202 --flush-privileges \
203 --all-databases > ${dataDir}/initial.sql 203 --master-data \
204 --all-databases > ${dataDir}/initial.sql
205 fi
204 206
205 ${hcfg.package}/bin/mysql_install_db \ 207 ${hcfg.package}/bin/mysql_install_db \
206 --defaults-file=/etc/mysql/${name}_my.cnf \ 208 --defaults-file=/etc/mysql/${name}_my.cnf \
@@ -224,6 +226,7 @@ in
224 let 226 let
225 sql_before = pkgs.writeText "mysql-initial-before" '' 227 sql_before = pkgs.writeText "mysql-initial-before" ''
226 DROP DATABASE test; 228 DROP DATABASE test;
229 INSTALL SONAME 'auth_pam';
227 ''; 230 '';
228 setupScript = pkgs.writeScript "mysql-setup" '' 231 setupScript = pkgs.writeScript "mysql-setup" ''
229 #!${pkgs.runtimeShell} -e 232 #!${pkgs.runtimeShell} -e