postgresql: move initdb to postgresql-setup

We shouldn't use sysvinit init script to initialize database when use systemd
as the init manager, so split initdb function to postgresql-setup.
Before starting postgresql server, we can use "postgresql-setup initdb" to
initialize the database cluster.

Signed-off-by: Chong Lu <Chong.Lu@windriver.com>
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
This commit is contained in:
Chong.Lu@windriver.com
2014-09-16 17:36:35 +08:00
committed by Martin Jansa
parent cf2ab9ecbf
commit dfa0b4c86d
3 changed files with 77 additions and 50 deletions
@@ -29,6 +29,7 @@ SRC_URI = "http://ftp.postgresql.org/pub/source/v${PV}/${BP}.tar.bz2 \
file://postgresql-bashprofile \
file://postgresql.pam \
file://0001-Use-pkg-config-for-libxml2-detection.patch \
file://postgresql-setup \
"
LEAD_SONAME = "libpq.so"
@@ -171,6 +172,7 @@ do_install_append() {
install -d ${D}${sysconfdir}/init.d
install -m 0755 ${WORKDIR}/${BPN}.init ${D}${sysconfdir}/init.d/${BPN}-server
sed -i -e "s/^PGVERSION=.*$/PGVERSION=${PV}/g" ${D}${sysconfdir}/init.d/${BPN}-server
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