PostgreSQL resource agent has wrong default paths

Bug #955164 reported by Andrew Mobbs
22
This bug affects 3 people
Affects Status Importance Assigned to Milestone
resource-agents (Ubuntu)
Invalid
Undecided
Unassigned
Precise
Expired
Undecided
Unassigned

Bug Description

The pgsql resource agent has default paths which don't match those used by the Ubuntu postgresql package

In the resource agent:
 * The default configuration file is /etc/postgresql/9.1/main/postgresql.conf
 * The default loction of pg_ctl is /usr/lib/postgresql/9.1/bin/pg_ctl
 * The default data directory is given as /var/lib/pgsql/data

This causes Pacemaker to be unable to start the postgresql server, and the following errors in /var/log/syslog:
Mar 14 14:51:38 OB1 pgsql[3533]: ERROR: Configuration file /var/lib/pgsql/data/postgresql.conf doesn't exist
Mar 14 14:51:38 OB1 pgsql[3533]: ERROR: Setup problem: couldn't find command: /usr/bin/pg_ctl

The problem is in the file /usr/lib/ocf/resource.d/heartbeat/pgsql

The following patch fixes these problems:
=============================================================================
--- pgsql.old 2012-03-14 15:17:09.123507205 +0000
+++ pgsql 2012-03-14 15:19:37.521641615 +0000
@@ -45,13 +45,13 @@
 }

 # Defaults
-OCF_RESKEY_pgctl_default=/usr/bin/pg_ctl
+OCF_RESKEY_pgctl_default=/usr/lib/postgresql/9.1/bin/pg_ctl
 OCF_RESKEY_psql_default=/usr/bin/psql
-OCF_RESKEY_pgdata_default=/var/lib/pgsql/data
+OCF_RESKEY_pgdata_default=/var/lib/postgresql/9.1/main
 OCF_RESKEY_pgdba_default=postgres
 OCF_RESKEY_pghost_default=""
 OCF_RESKEY_pgport_default=5432
-OCF_RESKEY_config_default=""
+OCF_RESKEY_config_default=/etc/postgresql/9.1/main/postgresql.conf
 OCF_RESKEY_start_opt_default=""
 OCF_RESKEY_pgdb_default=template1
 OCF_RESKEY_logfile_default=/dev/null
=============================================================================

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in pacemaker (Ubuntu):
status: New → Confirmed
Revision history for this message
Andreas Ntaflos (daff) wrote :

This is not really a bug. Sure, the resource agent has defaults set that don't match Ubuntu's, but every relevant parameter can (and probably should) be set explicitly in the CIB. For example:

primitive p_postgresql ocf:heartbeat:pgsql \
        params pgctl="/usr/lib/postgresql/9.1/bin/pg_ctl" psql="/usr/bin/psql" pgdata="/var/lib/postgresql/9.1/main" config="/etc/postgresql/9.1/main/postgresql.conf" logfile="/var/log/postgresql/postgresql-9.1-main.log" \
        op start interval="0" timeout="120s" \
        op stop interval="0" timeout="120s" \
        op monitor interval="30s" timeout="30s"

The resource agent is able to start a PostgreSQL server just fine, having the parameters set to correct values.

Revision history for this message
Rafael David Tinoco (rafaeldtinoco) wrote :

Thank you for taking the time to report this bug. In an effort to keep an
up-to-date and valid list of bugs to work on, I have reviewed this report
to verify it still requires effort and occurs on an Ubuntu release in
standard support, and it does not.

It is unfortunate that we were unable to resolve this defect, however
there appears to be no further action possible at this time. I am
therefore moving the bug to 'Incomplete'. If you disagree or have
new information, we would be grateful if you could please add a comment
stating why and then change the status of the bug to 'New'.

Observation:

The correct affected package for this bug is resource-agents:

(k)rafaeldtinoco@clufocal01:~$ dpkg -L resource-agents | grep -i pgsql
/usr/lib/ocf/resource.d/heartbeat/pgsql

and I'm opening a generic bug to check ALL resource agents paths
existence.

no longer affects: pacemaker (Ubuntu)
Changed in resource-agents (Ubuntu Precise):
status: New → Incomplete
Changed in resource-agents (Ubuntu):
status: New → Invalid
Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for resource-agents (Ubuntu Precise) because there has been no activity for 60 days.]

Changed in resource-agents (Ubuntu Precise):
status: Incomplete → Expired
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.