aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVijay Venkatesh Kumar <vv770d@att.com>2017-05-15 03:16:16 +0000
committerGerrit Code Review <gerrit@onap.org>2017-05-15 03:16:16 +0000
commit7c0f3ce19a502317e15f381b15e06930a1952dbc (patch)
treed09a32691ec014f5571ab6fa2acaf9a949d31348
parent7d41ad61e2a3b17505123d1aa7b56fb14d3f143d (diff)
parent844a29c7570aa10775b34fe28dcc022de65fed4c (diff)
Merge "[DCAE-20] fix problem with config change"
-rw-r--r--cdf/src/cdf-prop-value/cdf-prop-value/src/main/java/cdf-prop-value.jarbin1593 -> 1593 bytes
-rw-r--r--cdf/src/cdf-prop-value/cdf-util/src/main/java/cdf-util.jarbin31099 -> 31099 bytes
-rwxr-xr-xpgaas/src/common/postinst12
-rwxr-xr-xpgaas/src/stage/opt/app/pgaas/bin/check_cluster6
-rwxr-xr-xpgaas/src/stage/opt/app/pgaas/bin/isrw14
-rwxr-xr-xpgaas/src/stage/opt/app/pgaas/bin/list_masters6
-rwxr-xr-xpgaas/src/stage/opt/app/pgaas/bin/pg_ctl_promote14
-rwxr-xr-xpgaas/src/stage/opt/app/pgaas/bin/pg_ctl_restart14
-rwxr-xr-xpgaas/src/stage/opt/app/pgaas/bin/pg_ctl_start14
-rwxr-xr-xpgaas/src/stage/opt/app/pgaas/bin/pg_ctl_status14
-rwxr-xr-xpgaas/src/stage/opt/app/pgaas/bin/pg_ctl_stop14
-rw-r--r--pgaas/src/stage/opt/app/pgaas/bin/repmgrc14
-rw-r--r--pgaas/src/stage/opt/app/pgaas/bin/repmgrdc14
-rwxr-xr-xpgaas/src/stage/opt/app/pgaas/bin/runpsql14
-rwxr-xr-xpgaas/src/stage/opt/app/pgaas/bin/runpsqll14
-rw-r--r--pgaas/src/stage/opt/app/pgaas/bin/startpsql14
-rwxr-xr-xpgaas/src/stage/opt/app/pgaas/bin/update_var_run_isrw14
-rw-r--r--postgresql-config/src/stage/opt/app/postgresql-config/etc/create-db-backup6
-rw-r--r--postgresql-config/src/stage/opt/app/postgresql-config/etc/do-post-install11
-rw-r--r--postgresql-config/src/stage/opt/app/postgresql-config/etc/lock-and-create-db-backup6
-rw-r--r--postgresql-config/src/stage/opt/app/postgresql-config/lib/profile.additions6
-rw-r--r--postgresql-config/src/stage/opt/app/postgresql-config/main/postgresql.conf.orig2
-rwxr-xr-xpostgresql-prep/src/common/postinst20
-rwxr-xr-xpostgresql-prep/src/stage/opt/app/postgresql-prep/bin/iDNS-responder.py9
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
--- 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
Binary files 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
--- 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
Binary files 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)