fix replication

This commit is contained in:
Jeffrey C. Ollie 2023-08-10 16:05:53 -05:00
parent 816abd49dc
commit 105e95b886
Signed by: jeff
GPG key ID: 6F86035A6D97044E

View file

@ -531,7 +531,7 @@
) // ( ) // (
if (cfg.replication.enable && cfg.replication.role == "replica") if (cfg.replication.enable && cfg.replication.role == "replica")
then { then {
PGPASSFILE = "${dataDir}/.pgpass"; PGPASSFILE = "${rootDir}/.pgpass";
} }
else { } else { }
); );
@ -564,8 +564,8 @@
else else
'' ''
read -r password < ${cfg.replication.passwordFile} read -r password < ${cfg.replication.passwordFile}
(umask 077; echo "${cfg.replication.primary.hostname}:${builtins.toString cfg.replication.primary.port}:replication:${cfg.replication.username}:''${password}" > ${dataDir}/.pgpass) (umask 077; echo "${cfg.replication.primary.hostname}:${builtins.toString cfg.replication.primary.port}:replication:${cfg.replication.username}:''${password}" > ${rootDir}/.pgpass)
chmod 0600 ${dataDir}/.pgpass chmod 0600 ${rootDir}/.pgpass
if [ ! -s "${dataDir}/PG_VERSION" ] if [ ! -s "${dataDir}/PG_VERSION" ]
then then