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 --- postgresql-prep/src/common/postinst | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) (limited to 'postgresql-prep/src/common/postinst') 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" -- cgit 1.2.3-korg