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 --- .../python/python-ceilometer_git.bb | 12 +++++++----- .../recipes-devtools/python/python-heat_git.bb | 10 ++++++---- .../recipes-devtools/python/python-keystone_git.bb | 16 +++++++++------- .../recipes-devtools/python/python-neutron_git.bb | 21 +++++++++++++-------- 4 files changed, 35 insertions(+), 24 deletions(-) (limited to 'meta-openstack/recipes-devtools/python') diff --git a/meta-openstack/recipes-devtools/python/python-ceilometer_git.bb b/meta-openstack/recipes-devtools/python/python-ceilometer_git.bb index fb5526d..5851500 100644 --- a/meta-openstack/recipes-devtools/python/python-ceilometer_git.bb +++ b/meta-openstack/recipes-devtools/python/python-ceilometer_git.bb @@ -58,16 +58,16 @@ do_install_append() { fi } -pkg_postinst_${SRCNAME}-controller () { +pkg_postinst_${SRCNAME}-setup () { if [ "x$D" != "x" ]; then exit 1 fi - + # This is to make sure postgres is configured and running if ! pidof postmaster > /dev/null; then /etc/init.d/postgresql-init /etc/init.d/postgresql start - sleep 5 + sleep 2 fi mkdir /var/log/ceilometer @@ -77,7 +77,9 @@ pkg_postinst_${SRCNAME}-controller () { inherit setuptools identity hosts update-rc.d -PACKAGES += "${SRCNAME}-common ${SRCNAME}-api ${SRCNAME}-collector ${SRCNAME}-compute ${SRCNAME}-controller" +PACKAGES += "${SRCNAME}-setup ${SRCNAME}-common ${SRCNAME}-api ${SRCNAME}-collector ${SRCNAME}-compute ${SRCNAME}-controller" + +ALLOW_EMPTY_${SRCNAME}-setup = "1" FILES_${PN} = "${libdir}/*" @@ -145,7 +147,7 @@ RDEPENDS_${PN} += " \ python-pytz \ " -RDEPENDS_${SRCNAME}-controller = "${PN} ${SRCNAME}-common postgresql postgresql-client python-psycopg2 tgt" +RDEPENDS_${SRCNAME}-controller = "${PN} ${SRCNAME}-setup ${SRCNAME}-common postgresql postgresql-client python-psycopg2 tgt" RDEPENDS_${SRCNAME}-api = "${SRCNAME}-controller" RDEPENDS_${SRCNAME}-collector = "${SRCNAME}-controller" RDEPENDS_${SRCNAME}-compute = "${PN} ${SRCNAME}-common python-ceilometerclient libvirt" diff --git a/meta-openstack/recipes-devtools/python/python-heat_git.bb b/meta-openstack/recipes-devtools/python/python-heat_git.bb index c560a8b..abe3517 100644 --- a/meta-openstack/recipes-devtools/python/python-heat_git.bb +++ b/meta-openstack/recipes-devtools/python/python-heat_git.bb @@ -61,7 +61,7 @@ do_install_append() { fi } -pkg_postinst_${SRCNAME}-engine () { +pkg_postinst_${SRCNAME}-setup () { if [ "x$D" != "x" ]; then exit 1 fi @@ -70,7 +70,7 @@ pkg_postinst_${SRCNAME}-engine () { if ! pidof postmaster > /dev/null; then /etc/init.d/postgresql-init /etc/init.d/postgresql start - sleep 5 + sleep 2 fi mkdir /var/log/heat @@ -81,6 +81,9 @@ pkg_postinst_${SRCNAME}-engine () { inherit setuptools identity hosts update-rc.d PACKAGES += "${SRCNAME}-common ${SRCNAME}-api ${SRCNAME}-api-cfn ${SRCNAME}-engine" +PACKAGES += "${SRCNAME}-setup" + +ALLOW_EMPTY_${SRCNAME}-setup = "1" FILES_${PN} = "${libdir}/*" @@ -98,7 +101,6 @@ FILES_${SRCNAME}-engine = "${bindir}/heat-engine \ ${bindir}/* \ ${sysconfdir}/init.d/heat-engine \ " - RDEPENDS_${PN} += " \ python-heatclient \ python-sqlalchemy \ @@ -144,7 +146,7 @@ RDEPENDS_${PN} += " \ python-pytz \ " -RDEPENDS_${SRCNAME}-engine = "${PN} ${SRCNAME}-common postgresql postgresql-client python-psycopg2 tgt" +RDEPENDS_${SRCNAME}-engine = "${PN} ${SRCNAME}-setup ${SRCNAME}-common postgresql postgresql-client python-psycopg2 tgt" RDEPENDS_${SRCNAME}-api = "${SRCNAME}-engine" RDEPENDS_${SRCNAME}-api-cfn = "${SRCNAME}-engine" diff --git a/meta-openstack/recipes-devtools/python/python-keystone_git.bb b/meta-openstack/recipes-devtools/python/python-keystone_git.bb index 882848a..e018d8d 100644 --- a/meta-openstack/recipes-devtools/python/python-keystone_git.bb +++ b/meta-openstack/recipes-devtools/python/python-keystone_git.bb @@ -50,7 +50,7 @@ do_install_append() { fi } -pkg_postinst_${SRCNAME} () { +pkg_postinst_${SRCNAME}-setup () { # python-keystone postinst start if [ "x$D" != "x" ]; then exit 1 @@ -58,9 +58,9 @@ pkg_postinst_${SRCNAME} () { # This is to make sure postgres is configured and running if ! pidof postmaster > /dev/null; then - /etc/init.d/postgresql-init - /etc/init.d/postgresql start - sleep 5 + /etc/init.d/postgresql-init + /etc/init.d/postgresql start + sleep 2 fi sudo -u postgres createdb keystone @@ -74,12 +74,14 @@ pkg_postinst_${SRCNAME} () { ADMIN_PASSWORD=${ADMIN_PASSWORD} \ SERVICE_PASSWORD=${SERVICE_PASSWORD} \ SERVICE_TENANT_NAME=${SERVICE_TENANT_NAME} \ - bash /etc/keystone/identity.sh + bash /etc/keystone/identity.sh # end python-keystone postinst } -PACKAGES += " ${SRCNAME}" +PACKAGES += " ${SRCNAME} ${SRCNAME}-setup" + +ALLOW_EMPTY_${SRCNAME}-setup = "1" FILES_${PN} = "${libdir}/*" @@ -107,7 +109,7 @@ RDEPENDS_${PN} += "python-pam \ python-dogpile.cache \ " -RDEPENDS_${SRCNAME} = "${PN} \ +RDEPENDS_${SRCNAME} = "${PN} ${SRCNAME}-setup \ postgresql postgresql-client python-psycopg2" INITSCRIPT_PACKAGES = "${SRCNAME}" diff --git a/meta-openstack/recipes-devtools/python/python-neutron_git.bb b/meta-openstack/recipes-devtools/python/python-neutron_git.bb index 588849a..1cb0b9f 100644 --- a/meta-openstack/recipes-devtools/python/python-neutron_git.bb +++ b/meta-openstack/recipes-devtools/python/python-neutron_git.bb @@ -65,30 +65,33 @@ do_install_append() { fi } -pkg_postinst_${SRCNAME} () { +pkg_postinst_${SRCNAME}-setup () { if [ "x$D" != "x" ]; then exit 1 fi # This is to make sure postgres is configured and running if ! pidof postmaster > /dev/null; then - /etc/init.d/postgresql-init - /etc/init.d/postgresql start - sleep 5 + /etc/init.d/postgresql-init + /etc/init.d/postgresql start + sleep 2 fi sudo -u postgres createdb ovs_neutron } -pkg_postinst_${SRCNAME}-plugin-openvswitch () { +pkg_postinst_${SRCNAME}-plugin-openvswitch-setup () { if [ "x$D" != "x" ]; then exit 1 fi - + /etc/init.d/openvswitch-switch start ovs-vsctl --no-wait -- --may-exist add-br br-int } +ALLOW_EMPTY_${SRCNAME}-setup = "1" +ALLOW_EMPTY_${SRCNAME}-plugin-openvswitch-setup = "1" + PACKAGES += " \ ${SRCNAME} \ ${SRCNAME}-doc \ @@ -99,6 +102,8 @@ PACKAGES += " \ ${SRCNAME}-l3-agent \ ${SRCNAME}-metadata-agent \ ${SRCNAME}-extra-agents \ + ${SRCNAME}-setup \ + ${SRCNAME}-plugin-openvswitch-setup \ " FILES_${PN} = "${libdir}/*" @@ -176,8 +181,8 @@ RDEPENDS_${PN} += "python-paste \ RDEPENDS_${SRCNAME} = "${PN} \ postgresql postgresql-client python-psycopg2" -RDEPENDS_${SRCNAME}-server = "${SRCNAME}" -RDEPENDS_${SRCNAME}-plugin-openvswitch = "${SRCNAME} openvswitch-switch " +RDEPENDS_${SRCNAME}-server = "${SRCNAME} ${SRCNAME}-setup" +RDEPENDS_${SRCNAME}-plugin-openvswitch = "${SRCNAME} ${SRCNAME}-plugin-openvswitch-setup openvswitch-switch " RDEPENDS_${SRCNAME}-plugin-linuxbridge = "${SRCNAME} bridge-utils" RDEPENDS_${SRCNAME}-dhcp-agent = "${SRCNAME} dnsmasq" RDEPENDS_${SRCNAME}-l3-agent = "${SRCNAME} ${SRCNAME}-metadata-agent iputils" -- cgit v1.2.3-54-g00ecf