diff options
author | Ismaël Bouya <ismael.bouya@normalesup.org> | 2021-10-13 02:24:38 +0200 |
---|---|---|
committer | Ismaël Bouya <ismael.bouya@normalesup.org> | 2021-10-14 16:21:31 +0200 |
commit | fd7935cf5ae343386c2243cd6bc7fbf52ba4ac65 (patch) | |
tree | e7dbc37c5ef3a702b4891838e67c025aee0b4916 | |
parent | 878d1583017483976ac64f26b4f806a05d445cf1 (diff) | |
download | Nix-fd7935cf5ae343386c2243cd6bc7fbf52ba4ac65.tar.gz Nix-fd7935cf5ae343386c2243cd6bc7fbf52ba4ac65.tar.zst Nix-fd7935cf5ae343386c2243cd6bc7fbf52ba4ac65.zip |
Fix mariadb replication
It adds the pam soname at install which is missing at first dump.
-rw-r--r-- | modules/private/databases/mariadb_replication.nix | 21 |
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 |