From 7db67a8eced8399d198bfa2cd6b9995f8842ead2 Mon Sep 17 00:00:00 2001 From: Mark Asselstine Date: Thu, 29 Mar 2018 15:29:12 -0400 Subject: postgresql: update all instances of PGDATA While investigating a postgresql startup issue I found we were only updating one instance of PGDATA where several exist. We do not use these other instances but they are files installed in the system and should reflect our customized setting for PGDATA. Signed-off-by: Mark Asselstine Signed-off-by: Bruce Ashfield --- meta-openstack/recipes-dbs/postgresql/postgresql_9.%.bbappend | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/meta-openstack/recipes-dbs/postgresql/postgresql_9.%.bbappend b/meta-openstack/recipes-dbs/postgresql/postgresql_9.%.bbappend index 5b87960..1b8a952 100644 --- a/meta-openstack/recipes-dbs/postgresql/postgresql_9.%.bbappend +++ b/meta-openstack/recipes-dbs/postgresql/postgresql_9.%.bbappend @@ -19,7 +19,6 @@ do_install_append() { install -m 0755 ${WORKDIR}/postgresql-init ${D_DEST_DIR}/postgresql-init sed -e "s:%DB_DATADIR%:${DB_DATADIR}:g" -i ${D_DEST_DIR}/postgresql-init - sed -e "s:\(PGDATA=\).*$:\1${DB_DATADIR}:g" -i ${D}${systemd_unitdir}/system/postgresql.service sed -e "s:%DB_USER%:${DB_USER}:g" -i ${D_DEST_DIR}/postgresql-init sed -e "s:%DB_PASSWORD%:${DB_PASSWORD}:g" -i ${D_DEST_DIR}/postgresql-init @@ -34,6 +33,16 @@ do_install_append() { PG_INIT_SERVICE_FILE=${D}${systemd_unitdir}/system/postgresql-init.service install -m 644 ${WORKDIR}/postgresql-init.service ${PG_INIT_SERVICE_FILE} sed -e "s:%SYSCONFIGDIR%:${sysconfdir}:g" -i ${PG_INIT_SERVICE_FILE} + + # Update PGDATA throughout + files="${D}${localstatedir}/lib/${BPN}/.bash_profile" + files="$files ${D}${systemd_unitdir}/system/postgresql.service" + files="$files ${D}${bindir}/${BPN}-setup" + files="$files ${D}${sysconfdir}/init.d/${BPN}-server" + for f in $files + do + sed -e "s:\(PGDATA=\).*$:\1${DB_DATADIR}:g" -i $f + done } PACKAGES += " ${PN}-setup" -- cgit v1.2.3-54-g00ecf