From 608fa75973c111c61cf55e99cf3172ff3f3f00b1 Mon Sep 17 00:00:00 2001 From: Bruce Ashfield Date: Fri, 4 Oct 2013 00:27:53 -0400 Subject: 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 --- meta-openstack/recipes-devtools/python/python-keystone_2013.1.3.bb | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'meta-openstack/recipes-devtools/python/python-keystone_2013.1.3.bb') 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} () { # This is to make sure postgres is configured and running if ! pidof postmaster > /dev/null; then - sudo -u postgres initdb -D /etc/postgresql/ - sleep 10 + /etc/init.d/postgresql-init /etc/init.d/postgresql start sleep 5 - sudo -u postgres psql -c "CREATE ROLE ${DB_USER} WITH SUPERUSER LOGIN PASSWORD '${DB_PASSWORD}'" fi sudo -u postgres createdb keystone -- cgit v1.2.3-54-g00ecf