diff options
Diffstat (limited to 'meta-openstack')
| -rw-r--r-- | meta-openstack/recipes-support/postgresql/postgresql_9.2.4.bbappend | 35 |
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 @@ | |||
| 1 | FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" | ||
| 2 | PRINC := "${@int(PRINC) + 1}" | ||
| 3 | |||
| 4 | SRC_URI += "file://postgresql" | ||
| 5 | |||
| 6 | inherit useradd update-rc.d identity | ||
| 7 | |||
| 8 | do_install_append() { | ||
| 9 | install -d ${D}${sysconfdir}/${PN} | ||
| 10 | chown postgres ${D}${sysconfdir}/${PN} | ||
| 11 | |||
| 12 | install -d ${D}${sysconfdir}/init.d/ | ||
| 13 | install -m 0755 ${WORKDIR}/postgresql ${D}${sysconfdir}/init.d/postgresql | ||
| 14 | } | ||
| 15 | |||
| 16 | USERADD_PACKAGES = "${PN}" | ||
| 17 | GROUPADD_PARAM_${PN} = "--system postgres" | ||
| 18 | USERADD_PARAM_${PN} = "--system --home /var/lib/postgres -g postgres \ | ||
| 19 | --no-create-home --shell /bin/false postgres" | ||
| 20 | |||
| 21 | pkg_postinst_${PN} () { | ||
| 22 | if [ "x$D" != "x" ]; then | ||
| 23 | exit 1 | ||
| 24 | fi | ||
| 25 | |||
| 26 | sudo -u postgres initdb -D /etc/${PN}/ | ||
| 27 | /etc/init.d/postgresql start | ||
| 28 | sudo -u postgres psql -c "CREATE ROLE ${DB_USER} WITH SUPERUSER LOGIN PASSWORD '${DB_PASSWORD}'" | ||
| 29 | ln -s /usr/share/zoneinfo /usr/share/postgresql/timezone | ||
| 30 | } | ||
| 31 | |||
| 32 | FILES_${PN} += "${localstatedir}/run/${PN}" | ||
| 33 | |||
| 34 | INITSCRIPT_NAME = "${PN}" | ||
| 35 | INITSCRIPT_PARAMS = "defaults" | ||
