aboutsummaryrefslogtreecommitdiffstats
path: root/meta-openstack/recipes-support
diff options
context:
space:
mode:
authorBruce Ashfield <bruce.ashfield@windriver.com>2013-08-12 15:39:04 -0400
committerBruce Ashfield <bruce.ashfield@windriver.com>2013-08-28 18:41:59 -0400
commit631c93f0b5499dcfc1fb8f95c25125655d4f9163 (patch)
tree467fd5e1b1573b5d4505d7185f2f38b519f32a76 /meta-openstack/recipes-support
parent1ca3fe03b5d248ba405b02b22f093083e84aff33 (diff)
downloadmeta-cloud-services-631c93f0b5499dcfc1fb8f95c25125655d4f9163.tar.gz
meta-cloud-services-631c93f0b5499dcfc1fb8f95c25125655d4f9163.tar.bz2
meta-cloud-services-631c93f0b5499dcfc1fb8f95c25125655d4f9163.zip
postgresql: add 9.2.4 bbappend
Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
Diffstat (limited to 'meta-openstack/recipes-support')
-rw-r--r--meta-openstack/recipes-support/postgresql/postgresql_9.2.4.bbappend35
1 files changed, 35 insertions, 0 deletions
diff --git a/meta-openstack/recipes-support/postgresql/postgresql_9.2.4.bbappend b/meta-openstack/recipes-support/postgresql/postgresql_9.2.4.bbappend
new file mode 100644
index 0000000..98e7207
--- /dev/null
+++ b/meta-openstack/recipes-support/postgresql/postgresql_9.2.4.bbappend
@@ -0,0 +1,35 @@
+FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
+PRINC := "${@int(PRINC) + 1}"
+
+SRC_URI += "file://postgresql"
+
+inherit useradd update-rc.d identity
+
+do_install_append() {
+ install -d ${D}${sysconfdir}/${PN}
+ chown postgres ${D}${sysconfdir}/${PN}
+
+ install -d ${D}${sysconfdir}/init.d/
+ install -m 0755 ${WORKDIR}/postgresql ${D}${sysconfdir}/init.d/postgresql
+}
+
+USERADD_PACKAGES = "${PN}"
+GROUPADD_PARAM_${PN} = "--system postgres"
+USERADD_PARAM_${PN} = "--system --home /var/lib/postgres -g postgres \
+ --no-create-home --shell /bin/false postgres"
+
+pkg_postinst_${PN} () {
+ if [ "x$D" != "x" ]; then
+ exit 1
+ fi
+
+ sudo -u postgres initdb -D /etc/${PN}/
+ /etc/init.d/postgresql start
+ sudo -u postgres psql -c "CREATE ROLE ${DB_USER} WITH SUPERUSER LOGIN PASSWORD '${DB_PASSWORD}'"
+ ln -s /usr/share/zoneinfo /usr/share/postgresql/timezone
+}
+
+FILES_${PN} += "${localstatedir}/run/${PN}"
+
+INITSCRIPT_NAME = "${PN}"
+INITSCRIPT_PARAMS = "defaults"