From bebcf13e5eca199d98a2c94ef1c20da50cba7f51 Mon Sep 17 00:00:00 2001 From: Bruce Ashfield Date: Wed, 20 Nov 2013 00:38:32 -0500 Subject: initscripts: split into -setup and init packages Many OpenStack modules require a first boot action to setup up users, databases, bridges, etc. These same packages install initscripts to start daemons and servers. The 1st boot package post install actions immediately exit to indicate that the action cannot be performed in the cross environment and instead should be done on first boot. The update-rc.d post install actions are intended to be run in the cross environment to symlink scripts into the proper runlevels. The early exit from the db setup routines, means that the rc files are not linked in host cross. If the rootfs doesn't contain update-rc.d, they also will not be set up on first boot. The end result is a system that does not start all of its required services on boot. To fix this, we split out db and other first boot setup tasks into dedicated (but empty) -setup packages. These run on first boot, while update-rc.d is left to create the proper symlinks. Signed-off-by: Bruce Ashfield --- .../recipes-support/postgresql/postgresql_9.2.4.bbappend | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'meta-openstack/recipes-support') diff --git a/meta-openstack/recipes-support/postgresql/postgresql_9.2.4.bbappend b/meta-openstack/recipes-support/postgresql/postgresql_9.2.4.bbappend index be7f036..1102ba5 100644 --- a/meta-openstack/recipes-support/postgresql/postgresql_9.2.4.bbappend +++ b/meta-openstack/recipes-support/postgresql/postgresql_9.2.4.bbappend @@ -32,16 +32,20 @@ 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} () { +PACKAGES += " ${PN}-setup" +ALLOW_EMPTY_${PN}-setup = "1" +RDEPENDS_${PN} += " ${PN}-setup" + +pkg_postinst_${PN}-setup () { # postgres 9.2.4 postinst if [ "x$D" != "x" ]; then exit 1 fi - + /etc/init.d/postgresql-init if [ $? -eq 0 ]; then - echo "[ERROR] postgres: unable to create admin account" - exit 1 + echo "[ERROR] postgres: unable to create admin account" + exit 1 fi } -- cgit v1.2.3-54-g00ecf