Skip to content

Commit 0c3f2cf

Browse files
committed
pgsql: Fixed an issue where tmpdir was not created when rep_mode was set to slave.
1 parent 968ad70 commit 0c3f2cf

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

heartbeat/pgsql

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1988,6 +1988,15 @@ validate_ocf_check_level_10() {
19881988
ocf_exit_reason "Replication(rep_mode=slave) does not support Master/Slave configuration."
19891989
return $OCF_ERR_CONFIGURED
19901990
fi
1991+
# For slave mode in PostgreSQL 12 and later, create the tmp directory to place recovery.conf.
1992+
ocf_version_cmp "$version" "12"
1993+
rc=$?
1994+
if [ $rc -eq 1 ]||[ $rc -eq 2 ]; then # PosrgreSQL 12 or later.
1995+
if ! mkdir -p $OCF_RESKEY_tmpdir || ! chown $OCF_RESKEY_pgdba $OCF_RESKEY_tmpdir || ! chmod 700 $OCF_RESKEY_tmpdir; then
1996+
ocf_exit_reason "Can't create directory $OCF_RESKEY_tmpdir or it is not readable by $OCF_RESKEY_pgdba"
1997+
return $OCF_ERR_PERM
1998+
fi
1999+
fi
19912000
fi
19922001

19932002
if use_replication_slot; then

0 commit comments

Comments
 (0)