t-matsuo/resource-agents — pull request #16 by soulhunter (2012-08-21 16:43:53+00:00)
Title: Unset PGPASSWORD before starting PostgreSQL to allow the use of .pgpass file for replication password.

Unset PGPASSWORD before starting PostgreSQL to allow the use of .pgpass file for replication password.

If we leave PGPASSWORD set, PostgreSQL process will ignore .pgpass file, and PGPASSWORD is set to monitor_password by the script (which can be different from replication password).

There maybe be better ways to fix this, for example, use another variable to hold the monitor_password, and set PGPASSWORD *only* when we will use it, and unset it afterwards (for example). Consider this commit a quick hack to fix the fact that PostgreSQL process was totally ignoring .pgpass file for replication, and was trying to use monitor_password for replication.