From 9d20db53be1131ecd9cc4ae968d44b8f79dab545 Mon Sep 17 00:00:00 2001 From: Otavio Salvador Date: Fri, 23 Nov 2018 09:43:19 -0200 Subject: postgresql: Allow successful run of postgresql-setup The postgresql-setup utility log-in on postgres user to create the database, however, the shell was set to bash and it wasn't being installed as runtime dependency. This rework this expectation to use busybox ash as shell and avoid the new dependency Signed-off-by: Otavio Salvador Signed-off-by: Khem Raj Signed-off-by: Armin Kuster --- meta-oe/recipes-dbs/postgresql/files/postgresql-bashprofile | 4 ---- meta-oe/recipes-dbs/postgresql/files/postgresql-profile | 4 ++++ meta-oe/recipes-dbs/postgresql/postgresql.inc | 8 ++++---- 3 files changed, 8 insertions(+), 8 deletions(-) delete mode 100644 meta-oe/recipes-dbs/postgresql/files/postgresql-bashprofile create mode 100644 meta-oe/recipes-dbs/postgresql/files/postgresql-profile diff --git a/meta-oe/recipes-dbs/postgresql/files/postgresql-bashprofile b/meta-oe/recipes-dbs/postgresql/files/postgresql-bashprofile deleted file mode 100644 index 1c931f37fd..0000000000 --- a/meta-oe/recipes-dbs/postgresql/files/postgresql-bashprofile +++ /dev/null @@ -1,4 +0,0 @@ -[ -f /etc/profile ] && source /etc/profile - -PGDATA=/var/lib/postgresql/data -export PGDATA diff --git a/meta-oe/recipes-dbs/postgresql/files/postgresql-profile b/meta-oe/recipes-dbs/postgresql/files/postgresql-profile new file mode 100644 index 0000000000..1c931f37fd --- /dev/null +++ b/meta-oe/recipes-dbs/postgresql/files/postgresql-profile @@ -0,0 +1,4 @@ +[ -f /etc/profile ] && source /etc/profile + +PGDATA=/var/lib/postgresql/data +export PGDATA diff --git a/meta-oe/recipes-dbs/postgresql/postgresql.inc b/meta-oe/recipes-dbs/postgresql/postgresql.inc index 3bf71f02e9..dc85224543 100644 --- a/meta-oe/recipes-dbs/postgresql/postgresql.inc +++ b/meta-oe/recipes-dbs/postgresql/postgresql.inc @@ -25,7 +25,7 @@ ARM_INSTRUCTION_SET = "arm" SRC_URI = "http://ftp.postgresql.org/pub/source/v${PV}/${BP}.tar.bz2 \ file://postgresql.init \ - file://postgresql-bashprofile \ + file://postgresql-profile \ file://postgresql.pam \ file://postgresql-setup \ file://postgresql.service \ @@ -155,7 +155,7 @@ usernum = "28" groupnum = "28" USERADD_PACKAGES = "${PN}" USERADD_PARAM_${PN} = "-M -g postgres -o -r -d ${localstatedir}/lib/${BPN} \ - -s /bin/bash -c 'PostgreSQL Server' -u ${usernum} postgres" + -s /bin/sh -c 'PostgreSQL Server' -u ${usernum} postgres" GROUPADD_PARAM_${PN} = "-g ${groupnum} -o -r postgres" INITSCRIPT_PACKAGES = "${PN}" @@ -182,7 +182,7 @@ do_install_append() { install -m 0755 ${WORKDIR}/${BPN}-setup ${D}${bindir}/${BPN}-setup install -d -m 700 ${D}${localstatedir}/lib/${BPN}/data install -d -m 700 ${D}${localstatedir}/lib/${BPN}/backups - install -m 644 ${WORKDIR}/${BPN}-bashprofile ${D}${localstatedir}/lib/${BPN}/.bash_profile + install -m 644 ${WORKDIR}/${BPN}-profile ${D}${localstatedir}/lib/${BPN}/.profile chown -R postgres:postgres ${D}${localstatedir}/lib/${BPN} # multiple server config directory install -d -m 700 ${D}${sysconfdir}/default/${BPN} @@ -222,7 +222,7 @@ RPROVIDES_${PN}-dbg += "libecpg-compat-dbg \ FILES_${PN} += "${sysconfdir}/init.d/${BPN}-server \ ${localstatedir}/lib/${BPN}/data ${localstatedir}/lib/${BPN}/backups \ - ${localstatedir}/lib/${BPN}/.bash_profile ${sysconfdir}/default/${BPN} \ + ${localstatedir}/lib/${BPN}/.profile ${sysconfdir}/default/${BPN} \ ${libdir}/${BPN}/dict_snowball.so ${libdir}/${BPN}/plpgsql.so \ ${libdir}/${BPN}/euc2004_sjis2004.so \ ${libdir}/${BPN}/libpqwalreceiver.so \ -- cgit 1.2.3-korg