summaryrefslogtreecommitdiffstats
path: root/meta-openstack/recipes-devtools/python
diff options
context:
space:
mode:
authorBruce Ashfield <bruce.ashfield@windriver.com>2013-11-20 00:38:32 -0500
committerBruce Ashfield <bruce.ashfield@windriver.com>2013-11-25 15:25:38 -0500
commitbebcf13e5eca199d98a2c94ef1c20da50cba7f51 (patch)
tree061bbfd39df6c5ec85eeefce05498bed46f55f03 /meta-openstack/recipes-devtools/python
parent466bdc6aed5d2ba0253e0e69f3cde88b11097ff8 (diff)
downloadmeta-cloud-services-bebcf13e5eca199d98a2c94ef1c20da50cba7f51.tar.gz
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 <bruce.ashfield@windriver.com>
Diffstat (limited to 'meta-openstack/recipes-devtools/python')
-rw-r--r--meta-openstack/recipes-devtools/python/python-ceilometer_git.bb12
-rw-r--r--meta-openstack/recipes-devtools/python/python-heat_git.bb10
-rw-r--r--meta-openstack/recipes-devtools/python/python-keystone_git.bb16
-rw-r--r--meta-openstack/recipes-devtools/python/python-neutron_git.bb21
4 files changed, 35 insertions, 24 deletions
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() {
58 fi 58 fi
59} 59}
60 60
61pkg_postinst_${SRCNAME}-controller () { 61pkg_postinst_${SRCNAME}-setup () {
62 if [ "x$D" != "x" ]; then 62 if [ "x$D" != "x" ]; then
63 exit 1 63 exit 1
64 fi 64 fi
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 /etc/init.d/postgresql-init 68 /etc/init.d/postgresql-init
69 /etc/init.d/postgresql start 69 /etc/init.d/postgresql start
70 sleep 5 70 sleep 2
71 fi 71 fi
72 72
73 mkdir /var/log/ceilometer 73 mkdir /var/log/ceilometer
@@ -77,7 +77,9 @@ pkg_postinst_${SRCNAME}-controller () {
77 77
78inherit setuptools identity hosts update-rc.d 78inherit setuptools identity hosts update-rc.d
79 79
80PACKAGES += "${SRCNAME}-common ${SRCNAME}-api ${SRCNAME}-collector ${SRCNAME}-compute ${SRCNAME}-controller" 80PACKAGES += "${SRCNAME}-setup ${SRCNAME}-common ${SRCNAME}-api ${SRCNAME}-collector ${SRCNAME}-compute ${SRCNAME}-controller"
81
82ALLOW_EMPTY_${SRCNAME}-setup = "1"
81 83
82FILES_${PN} = "${libdir}/*" 84FILES_${PN} = "${libdir}/*"
83 85
@@ -145,7 +147,7 @@ RDEPENDS_${PN} += " \
145 python-pytz \ 147 python-pytz \
146 " 148 "
147 149
148RDEPENDS_${SRCNAME}-controller = "${PN} ${SRCNAME}-common postgresql postgresql-client python-psycopg2 tgt" 150RDEPENDS_${SRCNAME}-controller = "${PN} ${SRCNAME}-setup ${SRCNAME}-common postgresql postgresql-client python-psycopg2 tgt"
149RDEPENDS_${SRCNAME}-api = "${SRCNAME}-controller" 151RDEPENDS_${SRCNAME}-api = "${SRCNAME}-controller"
150RDEPENDS_${SRCNAME}-collector = "${SRCNAME}-controller" 152RDEPENDS_${SRCNAME}-collector = "${SRCNAME}-controller"
151RDEPENDS_${SRCNAME}-compute = "${PN} ${SRCNAME}-common python-ceilometerclient libvirt" 153RDEPENDS_${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() {
61 fi 61 fi
62} 62}
63 63
64pkg_postinst_${SRCNAME}-engine () { 64pkg_postinst_${SRCNAME}-setup () {
65 if [ "x$D" != "x" ]; then 65 if [ "x$D" != "x" ]; then
66 exit 1 66 exit 1
67 fi 67 fi
@@ -70,7 +70,7 @@ pkg_postinst_${SRCNAME}-engine () {
70 if ! pidof postmaster > /dev/null; then 70 if ! pidof postmaster > /dev/null; then
71 /etc/init.d/postgresql-init 71 /etc/init.d/postgresql-init
72 /etc/init.d/postgresql start 72 /etc/init.d/postgresql start
73 sleep 5 73 sleep 2
74 fi 74 fi
75 75
76 mkdir /var/log/heat 76 mkdir /var/log/heat
@@ -81,6 +81,9 @@ pkg_postinst_${SRCNAME}-engine () {
81inherit setuptools identity hosts update-rc.d 81inherit setuptools identity hosts update-rc.d
82 82
83PACKAGES += "${SRCNAME}-common ${SRCNAME}-api ${SRCNAME}-api-cfn ${SRCNAME}-engine" 83PACKAGES += "${SRCNAME}-common ${SRCNAME}-api ${SRCNAME}-api-cfn ${SRCNAME}-engine"
84PACKAGES += "${SRCNAME}-setup"
85
86ALLOW_EMPTY_${SRCNAME}-setup = "1"
84 87
85FILES_${PN} = "${libdir}/*" 88FILES_${PN} = "${libdir}/*"
86 89
@@ -98,7 +101,6 @@ FILES_${SRCNAME}-engine = "${bindir}/heat-engine \
98 ${bindir}/* \ 101 ${bindir}/* \
99 ${sysconfdir}/init.d/heat-engine \ 102 ${sysconfdir}/init.d/heat-engine \
100" 103"
101
102RDEPENDS_${PN} += " \ 104RDEPENDS_${PN} += " \
103 python-heatclient \ 105 python-heatclient \
104 python-sqlalchemy \ 106 python-sqlalchemy \
@@ -144,7 +146,7 @@ RDEPENDS_${PN} += " \
144 python-pytz \ 146 python-pytz \
145 " 147 "
146 148
147RDEPENDS_${SRCNAME}-engine = "${PN} ${SRCNAME}-common postgresql postgresql-client python-psycopg2 tgt" 149RDEPENDS_${SRCNAME}-engine = "${PN} ${SRCNAME}-setup ${SRCNAME}-common postgresql postgresql-client python-psycopg2 tgt"
148RDEPENDS_${SRCNAME}-api = "${SRCNAME}-engine" 150RDEPENDS_${SRCNAME}-api = "${SRCNAME}-engine"
149RDEPENDS_${SRCNAME}-api-cfn = "${SRCNAME}-engine" 151RDEPENDS_${SRCNAME}-api-cfn = "${SRCNAME}-engine"
150 152
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() {
50 fi 50 fi
51} 51}
52 52
53pkg_postinst_${SRCNAME} () { 53pkg_postinst_${SRCNAME}-setup () {
54 # python-keystone postinst start 54 # python-keystone postinst start
55 if [ "x$D" != "x" ]; then 55 if [ "x$D" != "x" ]; then
56 exit 1 56 exit 1
@@ -58,9 +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 /etc/init.d/postgresql-init 61 /etc/init.d/postgresql-init
62 /etc/init.d/postgresql start 62 /etc/init.d/postgresql start
63 sleep 5 63 sleep 2
64 fi 64 fi
65 65
66 sudo -u postgres createdb keystone 66 sudo -u postgres createdb keystone
@@ -74,12 +74,14 @@ pkg_postinst_${SRCNAME} () {
74 ADMIN_PASSWORD=${ADMIN_PASSWORD} \ 74 ADMIN_PASSWORD=${ADMIN_PASSWORD} \
75 SERVICE_PASSWORD=${SERVICE_PASSWORD} \ 75 SERVICE_PASSWORD=${SERVICE_PASSWORD} \
76 SERVICE_TENANT_NAME=${SERVICE_TENANT_NAME} \ 76 SERVICE_TENANT_NAME=${SERVICE_TENANT_NAME} \
77 bash /etc/keystone/identity.sh 77 bash /etc/keystone/identity.sh
78 78
79 # end python-keystone postinst 79 # end python-keystone postinst
80} 80}
81 81
82PACKAGES += " ${SRCNAME}" 82PACKAGES += " ${SRCNAME} ${SRCNAME}-setup"
83
84ALLOW_EMPTY_${SRCNAME}-setup = "1"
83 85
84FILES_${PN} = "${libdir}/*" 86FILES_${PN} = "${libdir}/*"
85 87
@@ -107,7 +109,7 @@ RDEPENDS_${PN} += "python-pam \
107 python-dogpile.cache \ 109 python-dogpile.cache \
108 " 110 "
109 111
110RDEPENDS_${SRCNAME} = "${PN} \ 112RDEPENDS_${SRCNAME} = "${PN} ${SRCNAME}-setup \
111 postgresql postgresql-client python-psycopg2" 113 postgresql postgresql-client python-psycopg2"
112 114
113INITSCRIPT_PACKAGES = "${SRCNAME}" 115INITSCRIPT_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() {
65 fi 65 fi
66} 66}
67 67
68pkg_postinst_${SRCNAME} () { 68pkg_postinst_${SRCNAME}-setup () {
69 if [ "x$D" != "x" ]; then 69 if [ "x$D" != "x" ]; then
70 exit 1 70 exit 1
71 fi 71 fi
72 72
73 # This is to make sure postgres is configured and running 73 # This is to make sure postgres is configured and running
74 if ! pidof postmaster > /dev/null; then 74 if ! pidof postmaster > /dev/null; then
75 /etc/init.d/postgresql-init 75 /etc/init.d/postgresql-init
76 /etc/init.d/postgresql start 76 /etc/init.d/postgresql start
77 sleep 5 77 sleep 2
78 fi 78 fi
79 79
80 sudo -u postgres createdb ovs_neutron 80 sudo -u postgres createdb ovs_neutron
81} 81}
82 82
83pkg_postinst_${SRCNAME}-plugin-openvswitch () { 83pkg_postinst_${SRCNAME}-plugin-openvswitch-setup () {
84 if [ "x$D" != "x" ]; then 84 if [ "x$D" != "x" ]; then
85 exit 1 85 exit 1
86 fi 86 fi
87 87
88 /etc/init.d/openvswitch-switch start 88 /etc/init.d/openvswitch-switch start
89 ovs-vsctl --no-wait -- --may-exist add-br br-int 89 ovs-vsctl --no-wait -- --may-exist add-br br-int
90} 90}
91 91
92ALLOW_EMPTY_${SRCNAME}-setup = "1"
93ALLOW_EMPTY_${SRCNAME}-plugin-openvswitch-setup = "1"
94
92PACKAGES += " \ 95PACKAGES += " \
93 ${SRCNAME} \ 96 ${SRCNAME} \
94 ${SRCNAME}-doc \ 97 ${SRCNAME}-doc \
@@ -99,6 +102,8 @@ PACKAGES += " \
99 ${SRCNAME}-l3-agent \ 102 ${SRCNAME}-l3-agent \
100 ${SRCNAME}-metadata-agent \ 103 ${SRCNAME}-metadata-agent \
101 ${SRCNAME}-extra-agents \ 104 ${SRCNAME}-extra-agents \
105 ${SRCNAME}-setup \
106 ${SRCNAME}-plugin-openvswitch-setup \
102 " 107 "
103 108
104FILES_${PN} = "${libdir}/*" 109FILES_${PN} = "${libdir}/*"
@@ -176,8 +181,8 @@ RDEPENDS_${PN} += "python-paste \
176RDEPENDS_${SRCNAME} = "${PN} \ 181RDEPENDS_${SRCNAME} = "${PN} \
177 postgresql postgresql-client python-psycopg2" 182 postgresql postgresql-client python-psycopg2"
178 183
179RDEPENDS_${SRCNAME}-server = "${SRCNAME}" 184RDEPENDS_${SRCNAME}-server = "${SRCNAME} ${SRCNAME}-setup"
180RDEPENDS_${SRCNAME}-plugin-openvswitch = "${SRCNAME} openvswitch-switch " 185RDEPENDS_${SRCNAME}-plugin-openvswitch = "${SRCNAME} ${SRCNAME}-plugin-openvswitch-setup openvswitch-switch "
181RDEPENDS_${SRCNAME}-plugin-linuxbridge = "${SRCNAME} bridge-utils" 186RDEPENDS_${SRCNAME}-plugin-linuxbridge = "${SRCNAME} bridge-utils"
182RDEPENDS_${SRCNAME}-dhcp-agent = "${SRCNAME} dnsmasq" 187RDEPENDS_${SRCNAME}-dhcp-agent = "${SRCNAME} dnsmasq"
183RDEPENDS_${SRCNAME}-l3-agent = "${SRCNAME} ${SRCNAME}-metadata-agent iputils" 188RDEPENDS_${SRCNAME}-l3-agent = "${SRCNAME} ${SRCNAME}-metadata-agent iputils"