diff options
author | Bruce Ashfield <bruce.ashfield@windriver.com> | 2013-11-20 00:38:32 -0500 |
---|---|---|
committer | Bruce Ashfield <bruce.ashfield@windriver.com> | 2013-11-25 15:25:38 -0500 |
commit | bebcf13e5eca199d98a2c94ef1c20da50cba7f51 (patch) | |
tree | 061bbfd39df6c5ec85eeefce05498bed46f55f03 /meta-openstack/recipes-devtools/python/python-neutron_git.bb | |
parent | 466bdc6aed5d2ba0253e0e69f3cde88b11097ff8 (diff) | |
download | meta-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/python-neutron_git.bb')
-rw-r--r-- | meta-openstack/recipes-devtools/python/python-neutron_git.bb | 21 |
1 files changed, 13 insertions, 8 deletions
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 | ||
68 | pkg_postinst_${SRCNAME} () { | 68 | pkg_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 | ||
83 | pkg_postinst_${SRCNAME}-plugin-openvswitch () { | 83 | pkg_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 | ||
92 | ALLOW_EMPTY_${SRCNAME}-setup = "1" | ||
93 | ALLOW_EMPTY_${SRCNAME}-plugin-openvswitch-setup = "1" | ||
94 | |||
92 | PACKAGES += " \ | 95 | PACKAGES += " \ |
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 | ||
104 | FILES_${PN} = "${libdir}/*" | 109 | FILES_${PN} = "${libdir}/*" |
@@ -176,8 +181,8 @@ RDEPENDS_${PN} += "python-paste \ | |||
176 | RDEPENDS_${SRCNAME} = "${PN} \ | 181 | RDEPENDS_${SRCNAME} = "${PN} \ |
177 | postgresql postgresql-client python-psycopg2" | 182 | postgresql postgresql-client python-psycopg2" |
178 | 183 | ||
179 | RDEPENDS_${SRCNAME}-server = "${SRCNAME}" | 184 | RDEPENDS_${SRCNAME}-server = "${SRCNAME} ${SRCNAME}-setup" |
180 | RDEPENDS_${SRCNAME}-plugin-openvswitch = "${SRCNAME} openvswitch-switch " | 185 | RDEPENDS_${SRCNAME}-plugin-openvswitch = "${SRCNAME} ${SRCNAME}-plugin-openvswitch-setup openvswitch-switch " |
181 | RDEPENDS_${SRCNAME}-plugin-linuxbridge = "${SRCNAME} bridge-utils" | 186 | RDEPENDS_${SRCNAME}-plugin-linuxbridge = "${SRCNAME} bridge-utils" |
182 | RDEPENDS_${SRCNAME}-dhcp-agent = "${SRCNAME} dnsmasq" | 187 | RDEPENDS_${SRCNAME}-dhcp-agent = "${SRCNAME} dnsmasq" |
183 | RDEPENDS_${SRCNAME}-l3-agent = "${SRCNAME} ${SRCNAME}-metadata-agent iputils" | 188 | RDEPENDS_${SRCNAME}-l3-agent = "${SRCNAME} ${SRCNAME}-metadata-agent iputils" |