diff options
| author | Bruce Ashfield <bruce.ashfield@windriver.com> | 2014-08-25 12:24:29 -0400 |
|---|---|---|
| committer | Bruce Ashfield <bruce.ashfield@windriver.com> | 2014-08-25 12:24:29 -0400 |
| commit | e9136650b58e24c4641e7cf008c857f349c92c03 (patch) | |
| tree | be0cd8306c86b7f8b888aae92520018783ce0148 /meta-openstack/recipes-dangling/postgresql | |
| parent | 634957bdf2e430fc252a638fb4e9499884385b4d (diff) | |
| download | meta-cloud-services-e9136650b58e24c4641e7cf008c857f349c92c03.tar.gz | |
recipes-dangling: remove all dangling bbappends
Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
Diffstat (limited to 'meta-openstack/recipes-dangling/postgresql')
3 files changed, 0 insertions, 170 deletions
diff --git a/meta-openstack/recipes-dangling/postgresql/postgresql/postgresql b/meta-openstack/recipes-dangling/postgresql/postgresql/postgresql deleted file mode 100644 index 5a34ec0..0000000 --- a/meta-openstack/recipes-dangling/postgresql/postgresql/postgresql +++ /dev/null | |||
| @@ -1,92 +0,0 @@ | |||
| 1 | #!/bin/sh | ||
| 2 | |||
| 3 | ### BEGIN INIT INFO | ||
| 4 | # Provides: postgresql | ||
| 5 | # Required-Start: $local_fs $remote_fs $network $time | ||
| 6 | # Required-Stop: $local_fs $remote_fs $network $time | ||
| 7 | # Should-Start: $syslog | ||
| 8 | # Should-Stop: $syslog | ||
| 9 | # Default-Start: 2 3 4 5 | ||
| 10 | # Default-Stop: 0 1 6 | ||
| 11 | # Short-Description: PostgreSQL RDBMS server | ||
| 12 | ### END INIT INFO | ||
| 13 | |||
| 14 | DAEMON=/usr/bin/postmaster | ||
| 15 | DESC="PostgreSQL RDBMS server" | ||
| 16 | |||
| 17 | datadir=`grep ^data_directory /etc/postgresql/postgresql.conf |sed -e "s#^.*= '##; s#'.*##"` | ||
| 18 | if [ "$datadir" = "" ] ; then | ||
| 19 | datadir=/etc/postgresql | ||
| 20 | else | ||
| 21 | if [ ! -e $datadir/postgresql.conf ] ; then | ||
| 22 | if [ -e /etc/postgresql/postgresql.conf -a -e $datadir ] ; then | ||
| 23 | ln -s /etc/postgresql/*.conf $datadir/ | ||
| 24 | fi | ||
| 25 | fi | ||
| 26 | fi | ||
| 27 | |||
| 28 | cd / | ||
| 29 | |||
| 30 | start () | ||
| 31 | { | ||
| 32 | echo -n "Starting postgres server..." | ||
| 33 | if pidof ${DAEMON} > /dev/null; then | ||
| 34 | echo "already running." | ||
| 35 | exit 0 | ||
| 36 | fi | ||
| 37 | touch /var/log/postgresql.log | ||
| 38 | chown postgres /var/log/postgresql.log | ||
| 39 | sudo -u postgres /usr/bin/pg_ctl start -w -D $datadir -s -l /var/log/postgresql.log | ||
| 40 | if [ $? -eq 0 ]; then | ||
| 41 | echo "done." | ||
| 42 | else | ||
| 43 | echo "failed." | ||
| 44 | fi | ||
| 45 | } | ||
| 46 | |||
| 47 | stop () | ||
| 48 | { | ||
| 49 | echo -n "Stopping postgres server..." | ||
| 50 | if ! pidof ${DAEMON} >/dev/null; then | ||
| 51 | echo "not running." | ||
| 52 | exit 0 | ||
| 53 | fi | ||
| 54 | sudo -u postgres /usr/bin/pg_ctl stop -w -D $datadir -m fast -s | ||
| 55 | if [ $? -eq 0 ]; then | ||
| 56 | echo "done." | ||
| 57 | else | ||
| 58 | if [ -f /etc/postgresql/postmaster.pid -a "$datadir" != "/etc/postgresql" ] ; then | ||
| 59 | # Special case for transition | ||
| 60 | sudo -u postgres /usr/bin/pg_ctl stop -w -D /etc/postgresql -m fast -s | ||
| 61 | fi | ||
| 62 | if ! pidof ${DAEMON} > /dev/null; then | ||
| 63 | echo "done." | ||
| 64 | else | ||
| 65 | echo "failed." | ||
| 66 | exit 1 | ||
| 67 | fi | ||
| 68 | fi | ||
| 69 | } | ||
| 70 | |||
| 71 | case "$1" in | ||
| 72 | start) | ||
| 73 | start | ||
| 74 | ;; | ||
| 75 | stop) | ||
| 76 | stop | ||
| 77 | ;; | ||
| 78 | force-reload) | ||
| 79 | stop | ||
| 80 | start | ||
| 81 | ;; | ||
| 82 | restart) | ||
| 83 | stop | ||
| 84 | start | ||
| 85 | ;; | ||
| 86 | *) | ||
| 87 | echo "Usage: $0 {start|stop|force-reload|restart}" | ||
| 88 | exit 1 | ||
| 89 | ;; | ||
| 90 | esac | ||
| 91 | |||
| 92 | exit 0 | ||
diff --git a/meta-openstack/recipes-dangling/postgresql/postgresql/postgresql-init b/meta-openstack/recipes-dangling/postgresql/postgresql/postgresql-init deleted file mode 100644 index c9c3807..0000000 --- a/meta-openstack/recipes-dangling/postgresql/postgresql/postgresql-init +++ /dev/null | |||
| @@ -1,43 +0,0 @@ | |||
| 1 | #!/bin/sh | ||
| 2 | # set -x | ||
| 3 | |||
| 4 | PN=postgresql | ||
| 5 | CONTROLLER_IP=%CONTROLLER_IP% | ||
| 6 | COMPUTE_IP=%COMPUTE_IP% | ||
| 7 | DB_USER=%DB_USER% | ||
| 8 | DB_PASSWORD=%DB_PASSWORD% | ||
| 9 | |||
| 10 | if [ -e /etc/${PN}/PG_VERSION ]; then | ||
| 11 | # the database has already been initialized, return | ||
| 12 | exit 0 | ||
| 13 | fi | ||
| 14 | |||
| 15 | sudo -u postgres initdb -D /etc/${PN}/ | ||
| 16 | echo "listen_addresses = '*'" >> /etc/${PN}/postgresql.conf | ||
| 17 | echo "host all all ${CONTROLLER_IP}/32 trust" >> /etc/${PN}/pg_hba.conf | ||
| 18 | echo "host all all ${COMPUTE_IP}/32 trust" >> /etc/${PN}/pg_hba.conf | ||
| 19 | /etc/init.d/postgresql start | ||
| 20 | |||
| 21 | count=0 | ||
| 22 | done=0 | ||
| 23 | while [ $count -le 10 ] && [ $done -eq 0 ]; do | ||
| 24 | sudo -u postgres psql -c "CREATE ROLE ${DB_USER} WITH SUPERUSER LOGIN PASSWORD '${DB_PASSWORD}'" 2> /dev/null | ||
| 25 | if [ $? -ne 0 ]; then | ||
| 26 | echo "[INFO] postgres: failed to create account for ${DB_USER}, trying again" | ||
| 27 | /etc/init.d/postgresql stop | ||
| 28 | sleep 3 | ||
| 29 | /etc/init.d/postgresql start | ||
| 30 | sleep 3 | ||
| 31 | else | ||
| 32 | echo "[INFO] postgres: created account for ${DB_USER}, continuing .. " | ||
| 33 | done=1 | ||
| 34 | fi | ||
| 35 | count=`expr $count + 1` | ||
| 36 | done | ||
| 37 | |||
| 38 | if [ $done -eq 0 ]; then | ||
| 39 | echo "[ERROR] postgres: unable to create admin account" | ||
| 40 | exit 1 | ||
| 41 | fi | ||
| 42 | |||
| 43 | ln -s /usr/share/zoneinfo /usr/share/postgresql/timezone || true | ||
diff --git a/meta-openstack/recipes-dangling/postgresql/postgresql_8.4.7.bbappend b/meta-openstack/recipes-dangling/postgresql/postgresql_8.4.7.bbappend deleted file mode 100644 index 98e7207..0000000 --- a/meta-openstack/recipes-dangling/postgresql/postgresql_8.4.7.bbappend +++ /dev/null | |||
| @@ -1,35 +0,0 @@ | |||
| 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" | ||
