aboutsummaryrefslogtreecommitdiffstats
path: root/postgresql-prep/src/common
diff options
context:
space:
mode:
authorTony Hansen <tony@att.com>2017-05-15 03:08:24 +0000
committerTony Hansen <tony@att.com>2017-05-15 03:08:46 +0000
commit844a29c7570aa10775b34fe28dcc022de65fed4c (patch)
tree9cb0a2b41864ac2df388da93d7e7d07d9606cd2b /postgresql-prep/src/common
parent48feaffcb16e1fd5eb3ce453b99797de1bd15d7a (diff)
[DCAE-20] fix problem with config change
Change-Id: Icc27ab79997b2aed85a061fc7f4680367896d4b4 Signed-off-by: Tony Hansen <tony@att.com>
Diffstat (limited to 'postgresql-prep/src/common')
-rwxr-xr-xpostgresql-prep/src/common/postinst20
1 files changed, 13 insertions, 7 deletions
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"