diff options
| author | Bruce Ashfield <bruce.ashfield@windriver.com> | 2013-10-04 00:27:53 -0400 |
|---|---|---|
| committer | Bruce Ashfield <bruce.ashfield@windriver.com> | 2013-10-04 13:16:33 -0400 |
| commit | 608fa75973c111c61cf55e99cf3172ff3f3f00b1 (patch) | |
| tree | fa3b3a3d457dc1daafdefa5c100379bcf3de1928 /meta-openstack/recipes-devtools/python | |
| parent | 6806482a7ba6f020b0cff44b2b797eede2b702af (diff) | |
| download | meta-cloud-services-608fa75973c111c61cf55e99cf3172ff3f3f00b1.tar.gz | |
postgresql: unify startup and initialization
Since we can't count on package postinst order, many components check for
a configured postgresql daemon, and if not found, initialize it.
Rather than sprinkling the knowledge of how to initialize the database
through all these packages, we create a more robust, central postgresql-init
script, and call it when any component needs the database configured.
Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
Diffstat (limited to 'meta-openstack/recipes-devtools/python')
5 files changed, 14 insertions, 17 deletions
diff --git a/meta-openstack/recipes-devtools/python/python-cinder_2013.1.3.bb b/meta-openstack/recipes-devtools/python/python-cinder_2013.1.3.bb index 1cdcd98..a6a10e5 100644 --- a/meta-openstack/recipes-devtools/python/python-cinder_2013.1.3.bb +++ b/meta-openstack/recipes-devtools/python/python-cinder_2013.1.3.bb | |||
| @@ -57,10 +57,8 @@ pkg_postinst_${SRCNAME} () { | |||
| 57 | 57 | ||
| 58 | # This is to make sure postgres is configured and running | 58 | # This is to make sure postgres is configured and running |
| 59 | if ! pidof postmaster > /dev/null; then | 59 | if ! pidof postmaster > /dev/null; then |
| 60 | sudo -u postgres initdb -D /etc/postgresql/ | 60 | /etc/init.d/postgresql-init |
| 61 | /etc/init.d/postgresql start | 61 | /etc/init.d/postgresql start |
| 62 | sleep 0.2 | ||
| 63 | sudo -u postgres psql -c "CREATE ROLE ${DB_USER} WITH SUPERUSER LOGIN PASSWORD '${DB_PASSWORD}'" | ||
| 64 | fi | 62 | fi |
| 65 | 63 | ||
| 66 | sudo -u postgres createdb cinder | 64 | sudo -u postgres createdb cinder |
diff --git a/meta-openstack/recipes-devtools/python/python-glance_2013.1.3.bb b/meta-openstack/recipes-devtools/python/python-glance_2013.1.3.bb index 9bfd262..ff81a0c 100644 --- a/meta-openstack/recipes-devtools/python/python-glance_2013.1.3.bb +++ b/meta-openstack/recipes-devtools/python/python-glance_2013.1.3.bb | |||
| @@ -65,10 +65,9 @@ pkg_postinst_${SRCNAME} () { | |||
| 65 | 65 | ||
| 66 | # This is to make sure postgres is configured and running | 66 | # This is to make sure postgres is configured and running |
| 67 | if ! pidof postmaster > /dev/null; then | 67 | if ! pidof postmaster > /dev/null; then |
| 68 | sudo -u postgres initdb -D /etc/postgresql/ | 68 | /etc/init.d/postgresql-init |
| 69 | /etc/init.d/postgresql start | 69 | /etc/init.d/postgresql start |
| 70 | sleep 0.2 | 70 | sleep 5 |
| 71 | sudo -u postgres psql -c "CREATE ROLE ${DB_USER} WITH SUPERUSER LOGIN PASSWORD '${DB_PASSWORD}'" | ||
| 72 | fi | 71 | fi |
| 73 | 72 | ||
| 74 | mkdir /var/log/glance | 73 | mkdir /var/log/glance |
diff --git a/meta-openstack/recipes-devtools/python/python-keystone_2013.1.3.bb b/meta-openstack/recipes-devtools/python/python-keystone_2013.1.3.bb index e124583..387fa68 100644 --- a/meta-openstack/recipes-devtools/python/python-keystone_2013.1.3.bb +++ b/meta-openstack/recipes-devtools/python/python-keystone_2013.1.3.bb | |||
| @@ -58,11 +58,9 @@ pkg_postinst_${SRCNAME} () { | |||
| 58 | 58 | ||
| 59 | # This is to make sure postgres is configured and running | 59 | # This is to make sure postgres is configured and running |
| 60 | if ! pidof postmaster > /dev/null; then | 60 | if ! pidof postmaster > /dev/null; then |
| 61 | sudo -u postgres initdb -D /etc/postgresql/ | 61 | /etc/init.d/postgresql-init |
| 62 | sleep 10 | ||
| 63 | /etc/init.d/postgresql start | 62 | /etc/init.d/postgresql start |
| 64 | sleep 5 | 63 | sleep 5 |
| 65 | sudo -u postgres psql -c "CREATE ROLE ${DB_USER} WITH SUPERUSER LOGIN PASSWORD '${DB_PASSWORD}'" | ||
| 66 | fi | 64 | fi |
| 67 | 65 | ||
| 68 | sudo -u postgres createdb keystone | 66 | sudo -u postgres createdb keystone |
diff --git a/meta-openstack/recipes-devtools/python/python-nova_2013.1.3.bb b/meta-openstack/recipes-devtools/python/python-nova_2013.1.3.bb index c2dd1f3..3552592 100644 --- a/meta-openstack/recipes-devtools/python/python-nova_2013.1.3.bb +++ b/meta-openstack/recipes-devtools/python/python-nova_2013.1.3.bb | |||
| @@ -16,6 +16,7 @@ SRC_URI = "https://launchpad.net/${SRCNAME}/grizzly/${PV}/+download/${SRCNAME}-$ | |||
| 16 | " | 16 | " |
| 17 | 17 | ||
| 18 | SRC_URI += "file://nova-all \ | 18 | SRC_URI += "file://nova-all \ |
| 19 | file://nova-compute \ | ||
| 19 | file://nova-consoleauth \ | 20 | file://nova-consoleauth \ |
| 20 | file://nova-novncproxy \ | 21 | file://nova-novncproxy \ |
| 21 | file://nova.conf \ | 22 | file://nova.conf \ |
| @@ -93,6 +94,7 @@ do_install_append() { | |||
| 93 | if ${@base_contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then | 94 | if ${@base_contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then |
| 94 | install -d ${D}${sysconfdir}/init.d | 95 | install -d ${D}${sysconfdir}/init.d |
| 95 | install -m 0755 ${WORKDIR}/nova-all ${D}${sysconfdir}/init.d/nova-all | 96 | install -m 0755 ${WORKDIR}/nova-all ${D}${sysconfdir}/init.d/nova-all |
| 97 | install -m 0755 ${WORKDIR}/nova-compute ${D}${sysconfdir}/init.d/nova-compute | ||
| 96 | install -m 0755 ${WORKDIR}/nova-consoleauth ${D}${sysconfdir}/init.d/nova-consoleauth | 98 | install -m 0755 ${WORKDIR}/nova-consoleauth ${D}${sysconfdir}/init.d/nova-consoleauth |
| 97 | install -m 0755 ${WORKDIR}/nova-novncproxy ${D}${sysconfdir}/init.d/nova-novncproxy | 99 | install -m 0755 ${WORKDIR}/nova-novncproxy ${D}${sysconfdir}/init.d/nova-novncproxy |
| 98 | fi | 100 | fi |
| @@ -197,14 +199,15 @@ RDEPENDS_${SRCNAME}-common = "${PN} openssl openssl-misc libxml2 libxslt \ | |||
| 197 | iptables curl dnsmasq sudo procps" | 199 | iptables curl dnsmasq sudo procps" |
| 198 | 200 | ||
| 199 | RDEPENDS_${SRCNAME}-controller = "${PN} ${SRCNAME}-common \ | 201 | RDEPENDS_${SRCNAME}-controller = "${PN} ${SRCNAME}-common \ |
| 200 | ${SRCNAME}-consoleauth \ | 202 | ${SRCNAME}-consoleauth \ |
| 201 | ${SRCNAME}-novncproxy \ | 203 | ${SRCNAME}-novncproxy \ |
| 202 | postgresql postgresql-client python-psycopg2" | 204 | postgresql postgresql-client python-psycopg2" |
| 203 | 205 | ||
| 204 | RDEPENDS_${SRCNAME}-compute = "${PN} ${SRCNAME}-common \ | 206 | RDEPENDS_${SRCNAME}-compute = "${PN} ${SRCNAME}-common \ |
| 205 | qemu libvirt libvirt-libvirtd libvirt-python libvirt-virsh" | 207 | qemu libvirt libvirt-libvirtd libvirt-python libvirt-virsh" |
| 206 | 208 | ||
| 207 | INITSCRIPT_PACKAGES = "${SRCNAME}-controller ${SRCNAME}-consoleauth ${SRCNAME}-novncproxy" | 209 | INITSCRIPT_PACKAGES = "${SRCNAME}-compute ${SRCNAME}-controller ${SRCNAME}-consoleauth ${SRCNAME}-novncproxy" |
| 208 | INITSCRIPT_NAME_${SRCNAME}-controller = "nova-all" | 210 | INITSCRIPT_NAME_${SRCNAME}-controller = "nova-all" |
| 211 | INITSCRIPT_NAME_${SRCNAME}-compute = "nova-compute" | ||
| 209 | INITSCRIPT_NAME_${SRCNAME}-consoleauth = "nova-consoleauth" | 212 | INITSCRIPT_NAME_${SRCNAME}-consoleauth = "nova-consoleauth" |
| 210 | INITSCRIPT_NAME_${SRCNAME}-novncproxy = "nova-novncproxy" | 213 | INITSCRIPT_NAME_${SRCNAME}-novncproxy = "nova-novncproxy" |
diff --git a/meta-openstack/recipes-devtools/python/python-quantum_2013.1.3.bb b/meta-openstack/recipes-devtools/python/python-quantum_2013.1.3.bb index 34da3c9..8198e6a 100644 --- a/meta-openstack/recipes-devtools/python/python-quantum_2013.1.3.bb +++ b/meta-openstack/recipes-devtools/python/python-quantum_2013.1.3.bb | |||
| @@ -74,10 +74,9 @@ pkg_postinst_${SRCNAME} () { | |||
| 74 | 74 | ||
| 75 | # This is to make sure postgres is configured and running | 75 | # This is to make sure postgres is configured and running |
| 76 | if ! pidof postmaster > /dev/null; then | 76 | if ! pidof postmaster > /dev/null; then |
| 77 | sudo -u postgres initdb -D /etc/postgresql/ | 77 | /etc/init.d/postgresql-init |
| 78 | /etc/init.d/postgresql start | 78 | /etc/init.d/postgresql start |
| 79 | sleep 0.2 | 79 | sleep 5 |
| 80 | sudo -u postgres psql -c "CREATE ROLE ${DB_USER} WITH SUPERUSER LOGIN PASSWORD '${DB_PASSWORD}'" | ||
| 81 | fi | 80 | fi |
| 82 | 81 | ||
| 83 | sudo -u postgres createdb ovs_quantum | 82 | sudo -u postgres createdb ovs_quantum |
