From 844a29c7570aa10775b34fe28dcc022de65fed4c Mon Sep 17 00:00:00 2001 From: Tony Hansen Date: Mon, 15 May 2017 03:08:24 +0000 Subject: [DCAE-20] fix problem with config change Change-Id: Icc27ab79997b2aed85a061fc7f4680367896d4b4 Signed-off-by: Tony Hansen --- .../cdf-prop-value/src/main/java/cdf-prop-value.jar | Bin 1593 -> 1593 bytes .../cdf-util/src/main/java/cdf-util.jar | Bin 31099 -> 31099 bytes pgaas/src/common/postinst | 12 ++++++++---- pgaas/src/stage/opt/app/pgaas/bin/check_cluster | 6 +++++- pgaas/src/stage/opt/app/pgaas/bin/isrw | 14 ++++++++------ pgaas/src/stage/opt/app/pgaas/bin/list_masters | 6 +++++- pgaas/src/stage/opt/app/pgaas/bin/pg_ctl_promote | 14 +++++++++----- pgaas/src/stage/opt/app/pgaas/bin/pg_ctl_restart | 14 +++++++++----- pgaas/src/stage/opt/app/pgaas/bin/pg_ctl_start | 14 +++++++++----- pgaas/src/stage/opt/app/pgaas/bin/pg_ctl_status | 14 +++++++++----- pgaas/src/stage/opt/app/pgaas/bin/pg_ctl_stop | 14 +++++++++----- pgaas/src/stage/opt/app/pgaas/bin/repmgrc | 14 +++++++++----- pgaas/src/stage/opt/app/pgaas/bin/repmgrdc | 14 +++++++++----- pgaas/src/stage/opt/app/pgaas/bin/runpsql | 14 ++++++++------ pgaas/src/stage/opt/app/pgaas/bin/runpsqll | 14 ++++++++------ pgaas/src/stage/opt/app/pgaas/bin/startpsql | 14 ++++++++------ .../src/stage/opt/app/pgaas/bin/update_var_run_isrw | 14 ++++++++------ .../opt/app/postgresql-config/etc/create-db-backup | 6 +++++- .../opt/app/postgresql-config/etc/do-post-install | 11 ++++++++--- .../postgresql-config/etc/lock-and-create-db-backup | 6 +++++- .../opt/app/postgresql-config/lib/profile.additions | 6 +++++- .../app/postgresql-config/main/postgresql.conf.orig | 2 +- postgresql-prep/src/common/postinst | 20 +++++++++++++------- .../opt/app/postgresql-prep/bin/iDNS-responder.py | 9 ++++++--- 24 files changed, 164 insertions(+), 88 deletions(-) diff --git a/cdf/src/cdf-prop-value/cdf-prop-value/src/main/java/cdf-prop-value.jar b/cdf/src/cdf-prop-value/cdf-prop-value/src/main/java/cdf-prop-value.jar index 041ad93..1f9a1c9 100644 Binary files a/cdf/src/cdf-prop-value/cdf-prop-value/src/main/java/cdf-prop-value.jar and b/cdf/src/cdf-prop-value/cdf-prop-value/src/main/java/cdf-prop-value.jar differ diff --git a/cdf/src/cdf-prop-value/cdf-util/src/main/java/cdf-util.jar b/cdf/src/cdf-prop-value/cdf-util/src/main/java/cdf-util.jar index 57e01c7..a5a86a6 100644 Binary files a/cdf/src/cdf-prop-value/cdf-util/src/main/java/cdf-util.jar and b/cdf/src/cdf-prop-value/cdf-util/src/main/java/cdf-util.jar differ diff --git a/pgaas/src/common/postinst b/pgaas/src/common/postinst index f24e364..dee5b56 100755 --- a/pgaas/src/common/postinst +++ b/pgaas/src/common/postinst @@ -32,10 +32,14 @@ set -x export CDFCFG=${INSTALL_ROOT}/opt/app/cdf/lib/cdf.cfg export PGAASCFG=${INSTALL_ROOT}/opt/app/pgaas/lib/pgaas.cfg -if [ -d /opt/app/postgresql-9.5.2 ] -then PGDIR=/opt/app/postgresql-9.5.2 -else PGDIR=/usr/lib/postgresql/9.5 -fi +if [ -d /opt/app/postgresql-9.5.2 ] +then PGDIR=/opt/app/postgresql-9.5.2 +elif [ -d /usr/lib/postgresql/9.6 ] +then PGDIR=/usr/lib/postgresql/9.6 +elif [ -d /usr/lib/postgresql/9.5 ] +then PGDIR=/usr/lib/postgresql/9.5 +else echo PostgreSQL bin directory not found +fi if [ -d /opt/app/postgresql-config-9.5.2/ ] then CFGDIR=/opt/app/postgresql-config-9.5.2 else CFGDIR=/opt/app/postgresql-config diff --git a/pgaas/src/stage/opt/app/pgaas/bin/check_cluster b/pgaas/src/stage/opt/app/pgaas/bin/check_cluster index c55d973..dbed877 100755 --- a/pgaas/src/stage/opt/app/pgaas/bin/check_cluster +++ b/pgaas/src/stage/opt/app/pgaas/bin/check_cluster @@ -32,7 +32,11 @@ CDF=/opt/app/cdf if [ -d /opt/app/postgresql-9.5.2 ] then PGDIR=/opt/app/postgresql-9.5.2 -else PGDIR=/usr/lib/postgresql/9.5 +elif [ -d /usr/lib/postgresql/9.6 ] +then PGDIR=/usr/lib/postgresql/9.6 +elif [ -d /usr/lib/postgresql/9.5 ] +then PGDIR=/usr/lib/postgresql/9.5 +else echo PostgreSQL bin directory not found 1>&2; exit 1 fi if [ -d /opt/app/postgresql-config-9.5.2/ ] then CFGDIR=/opt/app/postgresql-config-9.5.2/ diff --git a/pgaas/src/stage/opt/app/pgaas/bin/isrw b/pgaas/src/stage/opt/app/pgaas/bin/isrw index 817030d..d9e925e 100755 --- a/pgaas/src/stage/opt/app/pgaas/bin/isrw +++ b/pgaas/src/stage/opt/app/pgaas/bin/isrw @@ -13,14 +13,16 @@ # permissions and limitations under the License. -if [ -d /usr/lib/postgresql/9.5/bin ] -then PATH=$PATH:/usr/lib/postgresql/9.5/bin -elif [ -d /opt/app/postgresql-9.5.2/bin ] -then PATH=$PATH:/opt/app/postgresql-9.5.2/bin -else echo "$0: Cannot find PostgreSQL bin" 1>&2; exit 1 +if [ -d /opt/app/postgresql-9.5.2 ] +then PGDIR=/opt/app/postgresql-9.5.2 +elif [ -d /usr/lib/postgresql/9.6 ] +then PGDIR=/usr/lib/postgresql/9.6 +elif [ -d /usr/lib/postgresql/9.5 ] +then PGDIR=/usr/lib/postgresql/9.5 +else echo PostgreSQL bin directory not found 1>&2; exit 1 fi -export PATH=$PATH:/opt/java/jdk/jdk170/bin:/opt/app/cdf/bin:/opt/app/pgaas/bin:$PATH +export PATH=$PATH:$PGDIR/bin:/opt/java/jdk/jdk170/bin:/opt/app/cdf/bin:/opt/app/pgaas/bin:$PATH if [ -f /var/run/postgresql/inmaintenance ] then diff --git a/pgaas/src/stage/opt/app/pgaas/bin/list_masters b/pgaas/src/stage/opt/app/pgaas/bin/list_masters index 9e22cd1..33ed79f 100755 --- a/pgaas/src/stage/opt/app/pgaas/bin/list_masters +++ b/pgaas/src/stage/opt/app/pgaas/bin/list_masters @@ -19,7 +19,11 @@ CDF=/opt/app/cdf if [ -d /opt/app/postgresql-9.5.2 ] then PGDIR=/opt/app/postgresql-9.5.2 -else PGDIR=/usr/lib/postgresql/9.5 +elif [ -d /usr/lib/postgresql/9.6 ] +then PGDIR=/usr/lib/postgresql/9.6 +elif [ -d /usr/lib/postgresql/9.5 ] +then PGDIR=/usr/lib/postgresql/9.5 +else echo PostgreSQL bin directory not found 1>&2; exit 1 fi if [ -d /opt/app/postgresql-config-9.5.2/ ] then CFGDIR=/opt/app/postgresql-config-9.5.2/ diff --git a/pgaas/src/stage/opt/app/pgaas/bin/pg_ctl_promote b/pgaas/src/stage/opt/app/pgaas/bin/pg_ctl_promote index b7d011c..c976afa 100755 --- a/pgaas/src/stage/opt/app/pgaas/bin/pg_ctl_promote +++ b/pgaas/src/stage/opt/app/pgaas/bin/pg_ctl_promote @@ -13,11 +13,15 @@ # permissions and limitations under the License. -if [ -d /usr/lib/postgresql/9.5/bin ] -then PATH=$PATH:/usr/lib/postgresql/9.5/bin -elif [ -d /opt/app/postgresql-9.5.2/bin ] -then PATH=$PATH:/opt/app/postgresql-9.5.2/bin -else echo "$0: Cannot find PostgreSQL bin" 1>&2; exit 1 +if [ -d /opt/app/postgresql-9.5.2 ] +then PGDIR=/opt/app/postgresql-9.5.2 +elif [ -d /usr/lib/postgresql/9.6 ] +then PGDIR=/usr/lib/postgresql/9.6 +elif [ -d /usr/lib/postgresql/9.5 ] +then PGDIR=/usr/lib/postgresql/9.5 +else echo PostgreSQL bin directory not found 1>&2; exit 1 fi +export PATH=$PATH:$PGDIR/bin + pg_ctl promote -D /dbroot/pgdata/main/ diff --git a/pgaas/src/stage/opt/app/pgaas/bin/pg_ctl_restart b/pgaas/src/stage/opt/app/pgaas/bin/pg_ctl_restart index db00739..e1ad0eb 100755 --- a/pgaas/src/stage/opt/app/pgaas/bin/pg_ctl_restart +++ b/pgaas/src/stage/opt/app/pgaas/bin/pg_ctl_restart @@ -13,13 +13,17 @@ # permissions and limitations under the License. -if [ -d /usr/lib/postgresql/9.5/bin ] -then PATH=$PATH:/usr/lib/postgresql/9.5/bin -elif [ -d /opt/app/postgresql-9.5.2/bin ] -then PATH=$PATH:/opt/app/postgresql-9.5.2/bin -else echo "$0: Cannot find PostgreSQL bin" 1>&2; exit 1 +if [ -d /opt/app/postgresql-9.5.2 ] +then PGDIR=/opt/app/postgresql-9.5.2 +elif [ -d /usr/lib/postgresql/9.6 ] +then PGDIR=/usr/lib/postgresql/9.6 +elif [ -d /usr/lib/postgresql/9.5 ] +then PGDIR=/usr/lib/postgresql/9.5 +else echo PostgreSQL bin directory not found 1>&2; exit 1 fi +export PATH=$PATH:$PGDIR/bin + if [ -f /opt/app/postgresql-config/main/postgresql.conf ] then CONF=/opt/app/postgresql-config/main/postgresql.conf elif [ -f /opt/app/postgresql-config-9.5.2/main/postgresql.conf ] diff --git a/pgaas/src/stage/opt/app/pgaas/bin/pg_ctl_start b/pgaas/src/stage/opt/app/pgaas/bin/pg_ctl_start index 8cb831c..d8841c8 100755 --- a/pgaas/src/stage/opt/app/pgaas/bin/pg_ctl_start +++ b/pgaas/src/stage/opt/app/pgaas/bin/pg_ctl_start @@ -13,13 +13,17 @@ # permissions and limitations under the License. -if [ -d /usr/lib/postgresql/9.5/bin ] -then PATH=$PATH:/usr/lib/postgresql/9.5/bin -elif [ -d /opt/app/postgresql-9.5.2/bin ] -then PATH=$PATH:/opt/app/postgresql-9.5.2/bin -else echo "$0: Cannot find PostgreSQL bin" 1>&2; exit 1 +if [ -d /opt/app/postgresql-9.5.2 ] +then PGDIR=/opt/app/postgresql-9.5.2 +elif [ -d /usr/lib/postgresql/9.6 ] +then PGDIR=/usr/lib/postgresql/9.6 +elif [ -d /usr/lib/postgresql/9.5 ] +then PGDIR=/usr/lib/postgresql/9.5 +else echo PostgreSQL bin directory not found 1>&2; exit 1 fi +export PATH=$PATH:$PGDIR/bin + if [ -f /opt/app/postgresql-config/main/postgresql.conf ] then CONF=/opt/app/postgresql-config/main/postgresql.conf elif [ -f /opt/app/postgresql-config-9.5.2/main/postgresql.conf ] diff --git a/pgaas/src/stage/opt/app/pgaas/bin/pg_ctl_status b/pgaas/src/stage/opt/app/pgaas/bin/pg_ctl_status index 416a00e..3383835 100755 --- a/pgaas/src/stage/opt/app/pgaas/bin/pg_ctl_status +++ b/pgaas/src/stage/opt/app/pgaas/bin/pg_ctl_status @@ -13,11 +13,15 @@ # permissions and limitations under the License. -if [ -d /usr/lib/postgresql/9.5/bin ] -then PATH=$PATH:/usr/lib/postgresql/9.5/bin -elif [ -d /opt/app/postgresql-9.5.2/bin ] -then PATH=$PATH:/opt/app/postgresql-9.5.2/bin -else echo "$0: Cannot find PostgreSQL bin" 1>&2; exit 1 +if [ -d /opt/app/postgresql-9.5.2 ] +then PGDIR=/opt/app/postgresql-9.5.2 +elif [ -d /usr/lib/postgresql/9.6 ] +then PGDIR=/usr/lib/postgresql/9.6 +elif [ -d /usr/lib/postgresql/9.5 ] +then PGDIR=/usr/lib/postgresql/9.5 +else echo PostgreSQL bin directory not found 1>&2; exit 1 fi +export PATH=$PATH:$PGDIR/bin + pg_ctl status -D /dbroot/pgdata/main/ diff --git a/pgaas/src/stage/opt/app/pgaas/bin/pg_ctl_stop b/pgaas/src/stage/opt/app/pgaas/bin/pg_ctl_stop index 0d9a23c..4f255a8 100755 --- a/pgaas/src/stage/opt/app/pgaas/bin/pg_ctl_stop +++ b/pgaas/src/stage/opt/app/pgaas/bin/pg_ctl_stop @@ -13,11 +13,15 @@ # permissions and limitations under the License. -if [ -d /usr/lib/postgresql/9.5/bin ] -then PATH=$PATH:/usr/lib/postgresql/9.5/bin -elif [ -d /opt/app/postgresql-9.5.2/bin ] -then PATH=$PATH:/opt/app/postgresql-9.5.2/bin -else echo "$0: Cannot find PostgreSQL bin" 1>&2; exit 1 +if [ -d /opt/app/postgresql-9.5.2 ] +then PGDIR=/opt/app/postgresql-9.5.2 +elif [ -d /usr/lib/postgresql/9.6 ] +then PGDIR=/usr/lib/postgresql/9.6 +elif [ -d /usr/lib/postgresql/9.5 ] +then PGDIR=/usr/lib/postgresql/9.5 +else echo PostgreSQL bin directory not found 1>&2; exit 1 fi +export PATH=$PATH:$PGDIR/bin + pg_ctl stop -D /dbroot/pgdata/main/ diff --git a/pgaas/src/stage/opt/app/pgaas/bin/repmgrc b/pgaas/src/stage/opt/app/pgaas/bin/repmgrc index 57240cf..7b1b586 100644 --- a/pgaas/src/stage/opt/app/pgaas/bin/repmgrc +++ b/pgaas/src/stage/opt/app/pgaas/bin/repmgrc @@ -12,13 +12,17 @@ # permissions and limitations under the License. -if [ -d /usr/lib/postgresql/9.5/bin ] -then PATH=$PATH:/usr/lib/postgresql/9.5/bin -elif [ -d /opt/app/postgresql-9.5.2/bin ] -then PATH=$PATH:/opt/app/postgresql-9.5.2/bin -else echo "$0: Cannot find PostgreSQL bin" 1>&2; exit 1 +if [ -d /opt/app/postgresql-9.5.2 ] +then PGDIR=/opt/app/postgresql-9.5.2 +elif [ -d /usr/lib/postgresql/9.6 ] +then PGDIR=/usr/lib/postgresql/9.6 +elif [ -d /usr/lib/postgresql/9.5 ] +then PGDIR=/usr/lib/postgresql/9.5 +else echo PostgreSQL bin directory not found 1>&2; exit 1 fi +export PATH=$PATH:$PGDIR/bin + if [ -f /opt/app/postgresql-config/main/repmgr.conf ] then CONF=/opt/app/postgresql-config/main/repmgr.conf elif [ -f /opt/app/postgresql-config-9.5.2/main/repmgr.conf ] diff --git a/pgaas/src/stage/opt/app/pgaas/bin/repmgrdc b/pgaas/src/stage/opt/app/pgaas/bin/repmgrdc index cfbaa22..4faed6b 100644 --- a/pgaas/src/stage/opt/app/pgaas/bin/repmgrdc +++ b/pgaas/src/stage/opt/app/pgaas/bin/repmgrdc @@ -12,13 +12,17 @@ # permissions and limitations under the License. -if [ -d /usr/lib/postgresql/9.5/bin ] -then PATH=$PATH:/usr/lib/postgresql/9.5/bin -elif [ -d /opt/app/postgresql-9.5.2/bin ] -then PATH=$PATH:/opt/app/postgresql-9.5.2/bin -else echo "$0: Cannot find PostgreSQL bin" 1>&2; exit 1 +if [ -d /opt/app/postgresql-9.5.2 ] +then PGDIR=/opt/app/postgresql-9.5.2 +elif [ -d /usr/lib/postgresql/9.6 ] +then PGDIR=/usr/lib/postgresql/9.6 +elif [ -d /usr/lib/postgresql/9.5 ] +then PGDIR=/usr/lib/postgresql/9.5 +else echo PostgreSQL bin directory not found 1>&2; exit 1 fi +export PATH=$PATH:$PGDIR/bin + if [ -f /opt/app/postgresql-config/main/repmgr.conf ] then CONF=/opt/app/postgresql-config/main/repmgr.conf elif [ -f /opt/app/postgresql-config-9.5.2/main/repmgr.conf ] diff --git a/pgaas/src/stage/opt/app/pgaas/bin/runpsql b/pgaas/src/stage/opt/app/pgaas/bin/runpsql index be7f705..fcb1196 100755 --- a/pgaas/src/stage/opt/app/pgaas/bin/runpsql +++ b/pgaas/src/stage/opt/app/pgaas/bin/runpsql @@ -13,14 +13,16 @@ # permissions and limitations under the License. -if [ -d /usr/lib/postgresql/9.5/bin ] -then PATH=$PATH:/usr/lib/postgresql/9.5/bin -elif [ -d /opt/app/postgresql-9.5.2/bin ] -then PATH=$PATH:/opt/app/postgresql-9.5.2/bin -else echo "$0: Cannot find PostgreSQL bin" 1>&2; exit 1 +if [ -d /opt/app/postgresql-9.5.2 ] +then PGDIR=/opt/app/postgresql-9.5.2 +elif [ -d /usr/lib/postgresql/9.6 ] +then PGDIR=/usr/lib/postgresql/9.6 +elif [ -d /usr/lib/postgresql/9.5 ] +then PGDIR=/usr/lib/postgresql/9.5 +else echo PostgreSQL bin directory not found 1>&2; exit 1 fi -export PATH=$PATH:/opt/java/jdk/jdk170/bin:/opt/app/cdf/bin:/opt/app/pgaas/bin +export PATH=$PATH:$PGDIR/bin:/opt/java/jdk/jdk170/bin:/opt/app/cdf/bin:/opt/app/pgaas/bin [ -z "$PGUSER" ] && PGUSER=postgres [ -z "$PGHOST" ] && PGHOST=`hostname -f` diff --git a/pgaas/src/stage/opt/app/pgaas/bin/runpsqll b/pgaas/src/stage/opt/app/pgaas/bin/runpsqll index 749ae5d..864fbf8 100755 --- a/pgaas/src/stage/opt/app/pgaas/bin/runpsqll +++ b/pgaas/src/stage/opt/app/pgaas/bin/runpsqll @@ -13,14 +13,16 @@ # permissions and limitations under the License. -if [ -d /usr/lib/postgresql/9.5/bin ] -then PATH=$PATH:/usr/lib/postgresql/9.5/bin -elif [ -d /opt/app/postgresql-9.5.2/bin ] -then PATH=$PATH:/opt/app/postgresql-9.5.2/bin -else echo "$0: Cannot find PostgreSQL bin" 1>&2; exit 1 +if [ -d /opt/app/postgresql-9.5.2 ] +then PGDIR=/opt/app/postgresql-9.5.2 +elif [ -d /usr/lib/postgresql/9.6 ] +then PGDIR=/usr/lib/postgresql/9.6 +elif [ -d /usr/lib/postgresql/9.5 ] +then PGDIR=/usr/lib/postgresql/9.5 +else echo PostgreSQL bin directory not found 1>&2; exit 1 fi -export PATH=$PATH:/opt/java/jdk/jdk170/bin:/opt/app/cdf/bin:/opt/app/pgaas/bin +export PATH=$PATH:$PGDIR/bin:/opt/java/jdk/jdk170/bin:/opt/app/cdf/bin:/opt/app/pgaas/bin [ -z "$PGUSER" ] && PGUSER=postgres [ -z "$PGHOST" ] && PGHOST=`hostname -f` diff --git a/pgaas/src/stage/opt/app/pgaas/bin/startpsql b/pgaas/src/stage/opt/app/pgaas/bin/startpsql index 5368fc8..9e5c5b4 100644 --- a/pgaas/src/stage/opt/app/pgaas/bin/startpsql +++ b/pgaas/src/stage/opt/app/pgaas/bin/startpsql @@ -13,14 +13,16 @@ # permissions and limitations under the License. -if [ -d /usr/lib/postgresql/9.5/bin ] -then PATH=$PATH:/usr/lib/postgresql/9.5/bin -elif [ -d /opt/app/postgresql-9.5.2/bin ] -then PATH=$PATH:/opt/app/postgresql-9.5.2/bin -else echo "$0: Cannot find PostgreSQL bin" 1>&2; exit 1 +if [ -d /opt/app/postgresql-9.5.2 ] +then PGDIR=/opt/app/postgresql-9.5.2 +elif [ -d /usr/lib/postgresql/9.6 ] +then PGDIR=/usr/lib/postgresql/9.6 +elif [ -d /usr/lib/postgresql/9.5 ] +then PGDIR=/usr/lib/postgresql/9.5 +else echo PostgreSQL bin directory not found 1>&2; exit 1 fi -export PATH=$PATH:/opt/java/jdk/jdk170/bin:/opt/app/cdf/bin:/opt/app/pgaas/bin +export PATH=$PATH:$PGDIR/bin:/opt/java/jdk/jdk170/bin:/opt/app/cdf/bin:/opt/app/pgaas/bin [ -z "$PGUSER" ] && PGUSER=postgres [ -z "$PGHOST" ] && PGHOST=`hostname -f` diff --git a/pgaas/src/stage/opt/app/pgaas/bin/update_var_run_isrw b/pgaas/src/stage/opt/app/pgaas/bin/update_var_run_isrw index 082c094..7b51b30 100755 --- a/pgaas/src/stage/opt/app/pgaas/bin/update_var_run_isrw +++ b/pgaas/src/stage/opt/app/pgaas/bin/update_var_run_isrw @@ -13,14 +13,16 @@ # permissions and limitations under the License. -if [ -d /usr/lib/postgresql/9.5/bin ] -then PATH=$PATH:/usr/lib/postgresql/9.5/bin -elif [ -d /opt/app/postgresql-9.5.2/bin ] -then PATH=$PATH:/opt/app/postgresql-9.5.2/bin -else echo "$0: Cannot find PostgreSQL bin" 1>&2; exit 1 +if [ -d /opt/app/postgresql-9.5.2 ] +then PGDIR=/opt/app/postgresql-9.5.2 +elif [ -d /usr/lib/postgresql/9.6 ] +then PGDIR=/usr/lib/postgresql/9.6 +elif [ -d /usr/lib/postgresql/9.5 ] +then PGDIR=/usr/lib/postgresql/9.5 +else echo PostgreSQL bin directory not found 1>&2; exit 1 fi -export PATH=$PATH:/opt/java/jdk/jdk170/bin:/opt/app/cdf/bin:/opt/app/pgaas/bin +export PATH=$PATH:$PGDIR/bin:/opt/java/jdk/jdk170/bin:/opt/app/cdf/bin:/opt/app/pgaas/bin for i in 1 2 3 4 5 6 do diff --git a/postgresql-config/src/stage/opt/app/postgresql-config/etc/create-db-backup b/postgresql-config/src/stage/opt/app/postgresql-config/etc/create-db-backup index 625ce57..d6e856b 100644 --- a/postgresql-config/src/stage/opt/app/postgresql-config/etc/create-db-backup +++ b/postgresql-config/src/stage/opt/app/postgresql-config/etc/create-db-backup @@ -15,7 +15,11 @@ if [ -d /opt/app/postgresql-9.5.2 ] then PGDIR=/opt/app/postgresql-9.5.2 -else PGDIR=/usr/lib/postgresql/9.5 +elif [ -d /usr/lib/postgresql/9.6 ] +then PGDIR=/usr/lib/postgresql/9.6 +elif [ -d /usr/lib/postgresql/9.5 ] +then PGDIR=/usr/lib/postgresql/9.5 +else echo PostgreSQL bin directory not found fi $PGDIR/bin/psql <<-EOF diff --git a/postgresql-config/src/stage/opt/app/postgresql-config/etc/do-post-install b/postgresql-config/src/stage/opt/app/postgresql-config/etc/do-post-install index 7e8c71b..a20edc6 100644 --- a/postgresql-config/src/stage/opt/app/postgresql-config/etc/do-post-install +++ b/postgresql-config/src/stage/opt/app/postgresql-config/etc/do-post-install @@ -28,10 +28,15 @@ die() [ -n "$OPENECOMP" ] || die "OPENECOMP is not set" [ -n "$NOTOPENECOMP" ] || die "NOTOPENECOMP is not set" -if $OPENECOMP -then export PGDIR=${INSTALL_ROOT}/usr/lib/postgresql/9.5 -else export PGDIR=${INSTALL_ROOT}/opt/app/postgresql-9.5.2 +if [ -d ${INSTALL_ROOT}/opt/app/postgresql-9.5.2 ] +then PGDIR=${INSTALL_ROOT}/opt/app/postgresql-9.5.2 +elif [ -d ${INSTALL_ROOT}/usr/lib/postgresql/9.6 ] +then PGDIR=${INSTALL_ROOT}/usr/lib/postgresql/9.6 +elif [ -d ${INSTALL_ROOT}/usr/lib/postgresql/9.5 ] +then PGDIR=${INSTALL_ROOT}/usr/lib/postgresql/9.5 +else die PostgreSQL bin directory not found fi +export PGDIR export DBROOT=/dbroot/pgdata/main export PATH=$PATH:${INSTALL_ROOT}/opt/app/postgresql-prep/bin diff --git a/postgresql-config/src/stage/opt/app/postgresql-config/etc/lock-and-create-db-backup b/postgresql-config/src/stage/opt/app/postgresql-config/etc/lock-and-create-db-backup index ff942e6..cb8586d 100644 --- a/postgresql-config/src/stage/opt/app/postgresql-config/etc/lock-and-create-db-backup +++ b/postgresql-config/src/stage/opt/app/postgresql-config/etc/lock-and-create-db-backup @@ -15,7 +15,11 @@ if [ -d /opt/app/postgresql-9.5.2 ] then PGDIR=${INSTALL_ROOT}/opt/app/postgresql-9.5.2 -else PGDIR=/usr/lib/postgresql/9.5 +elif [ -d /usr/lib/postgresql/9.6 ] +then PGDIR=/usr/lib/postgresql/9.6 +elif [ -d /usr/lib/postgresql/9.5 ] +then PGDIR=/usr/lib/postgresql/9.5 +else echo PostgreSQL bin directory not found fi export PATH=$PGDIR/bin:${INSTALL_ROOT}/opt/java/jdk/jdk170/bin:${INSTALL_ROOT}/opt/app/cdf/bin:${INSTALL_ROOT}/opt/app/pgaas/bin:$PATH diff --git a/postgresql-config/src/stage/opt/app/postgresql-config/lib/profile.additions b/postgresql-config/src/stage/opt/app/postgresql-config/lib/profile.additions index 3ee8128..9616494 100644 --- a/postgresql-config/src/stage/opt/app/postgresql-config/lib/profile.additions +++ b/postgresql-config/src/stage/opt/app/postgresql-config/lib/profile.additions @@ -1,6 +1,10 @@ if [ -d /opt/app/postgresql-9.5.2 ] then PGDIR=/opt/app/postgresql-9.5.2 -else PGDIR=/usr/lib/postgresql/9.5 +elif [ -d /usr/lib/postgresql/9.6 ] +then PGDIR=/usr/lib/postgresql/9.6 +elif [ -d /usr/lib/postgresql/9.5 ] +then PGDIR=/usr/lib/postgresql/9.5 +else echo PostgreSQL bin directory not found fi export PATH="$PGDIR/bin:/opt/app/cdf/bin:/opt/app/pgaas/bin:/opt/app/postgresql-prep/bin:$PATH" diff --git a/postgresql-config/src/stage/opt/app/postgresql-config/main/postgresql.conf.orig b/postgresql-config/src/stage/opt/app/postgresql-config/main/postgresql.conf.orig index b2587db..e930458 100644 --- a/postgresql-config/src/stage/opt/app/postgresql-config/main/postgresql.conf.orig +++ b/postgresql-config/src/stage/opt/app/postgresql-config/main/postgresql.conf.orig @@ -49,7 +49,7 @@ ident_file = '%CFGDIR%/main/pg_ident.conf' # for DCAE # (change requires restart) # If external_pid_file is not explicitly set, no extra PID file is written. -external_pid_file = '/var/run/postgresql/9.5-main.pid' # for DCAE +external_pid_file = '/var/run/postgresql/main.pid' # for DCAE #external_pid_file = '' # write an extra PID file # (change requires restart) diff --git a/postgresql-prep/src/common/postinst b/postgresql-prep/src/common/postinst index bad825b..6f0218e 100755 --- a/postgresql-prep/src/common/postinst +++ b/postgresql-prep/src/common/postinst @@ -56,7 +56,7 @@ case "$CONFCOUNT" in # PG_NODES : uiopmno1qwpstg00.research.example.com|asbczw1vepstg00.dcae.simpledemo.openecomp.org # PG_JAVA_HOME : /opt/app/java/jdk/jdk170 # PG_CLUSTER : global - sed -e 's/ *: */="/' -e 's/[ ]*$/"/' -e 's/=""/="/' -e 's/""$/"/' < /tmp/postgres.conf > $TMP + cat $CONFDIR/*-postgres.conf | sed -e 's/ *: */="/' -e 's/[ ]*$/"/' -e 's/=""/="/' -e 's/""$/"/' > $TMP . $TMP ;; 0 ) ;; @@ -84,11 +84,17 @@ chmod 700 ${INSTALL_ROOT}/dbroot/pgdata/main if $OPENECOMP then - mv /var/lib/postgresql/9.5/main /var/lib/postgresql/9.5/main.sv - ln -s /dbroot/dbdata/main /var/lib/postgresql/9.5/main - - mv /etc/postgresql/9.5/main /etc/postgresql/9.5/main.sv - ln -s /opt/app/postgresql-config/main /etc/postgresql/9.5/main + if [ -d /var/lib/postgresql/9.5 ] + then VER=9.5 + elif [ -d /var/lib/postgresql/9.6 ] + then VER=9.6 + else die "Cannot determine version of PostgreSQL. Looking for /var/lib/postgresql/9.[56]." + fi + mv /var/lib/postgresql/$VER/main /var/lib/postgresql/$VER/main.sv + ln -s /dbroot/dbdata/main /var/lib/postgresql/$VER/main + + mv /etc/postgresql/$VER/main /etc/postgresql/$VER/main.sv + ln -s /opt/app/postgresql-config/main /etc/postgresql/$VER/main fi @@ -135,7 +141,7 @@ fi INIT=${INSTALL_ROOT}/opt/app/postgresql-prep/init -if $OPENECOMP +if [ -d /lib/systemd/system -a -f /bin/systemctl ] then su postgres -c "crontab $INIT/pglogs.cron" diff --git a/postgresql-prep/src/stage/opt/app/postgresql-prep/bin/iDNS-responder.py b/postgresql-prep/src/stage/opt/app/postgresql-prep/bin/iDNS-responder.py index 14c16b3..baaeb8b 100755 --- a/postgresql-prep/src/stage/opt/app/postgresql-prep/bin/iDNS-responder.py +++ b/postgresql-prep/src/stage/opt/app/postgresql-prep/bin/iDNS-responder.py @@ -258,12 +258,15 @@ class MyHandler(http.server.BaseHTTPRequestHandler): Then call ps -fu postgres and make sure we're not waiting on a master: postgres 20815 20812 0 15:52 ? 00:00:00 postgres: startup process waiting for 000000010000000000000001 """ - PGCTLPATH1 = "/usr/lib/postgresql/9.5/bin/pg_ctl" - PGCTLPATH2 = "/opt/app/postgresql-9.5.2/bin/pg_ctl" + PGCTLPATH1 = "/usr/lib/postgresql/9.6/bin/pg_ctl" + PGCTLPATH2 = "/usr/lib/postgresql/9.5/bin/pg_ctl" + PGCTLPATH3 = "/opt/app/postgresql-9.5.2/bin/pg_ctl" if isExe(PGCTLPATH1): statusLines = readPipe(PGCTLPATH1 + " status -D /dbroot/pgdata/main/") - else: + elif isExe(PGCTLPATH2): statusLines = readPipe(PGCTLPATH2 + " status -D /dbroot/pgdata/main/") + else: + statusLines = readPipe(PGCTLPATH3 + " status -D /dbroot/pgdata/main/") debugTrace("isServerUp(): statusLines = %s" % statusLines) psLines = readPipe("ps -fu postgres") debugTrace("isServerUp(): ps -fu postgres = %s" % psLines) -- cgit 1.2.3-korg