From 3bbd08214617f5a5e7b54253f9f8b786623546c8 Mon Sep 17 00:00:00 2001 From: Amy Fong Date: Thu, 24 Jul 2014 13:04:41 -0400 Subject: openstack initscript: add reset Some of the openstack data is associated with external resources (ie glance may have external files), we explicitly invoke the delete commands on those in additional to dropping and recreating the databases. Signed-off-by: Amy Fong --- .../recipes-devtools/python/python-heat/heat.init | 24 +++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) (limited to 'meta-openstack/recipes-devtools/python/python-heat/heat.init') diff --git a/meta-openstack/recipes-devtools/python/python-heat/heat.init b/meta-openstack/recipes-devtools/python/python-heat/heat.init index 4d8c180..5e0719f 100644 --- a/meta-openstack/recipes-devtools/python/python-heat/heat.init +++ b/meta-openstack/recipes-devtools/python/python-heat/heat.init @@ -76,6 +76,25 @@ status() echo "$DESC is not running" } +reset() +{ + stop + + # 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 2 + fi + + [ ! -d /var/log/heat ] && mkdir /var/log/heat + sudo -u postgres dropdb heat + sudo -u postgres createdb heat + heat-manage db_sync + + start +} + case "$1" in start) start @@ -90,8 +109,11 @@ case "$1" in status) status ;; + reset) + reset + ;; *) - echo "Usage: $0 {start|stop|force-reload|restart|reload|status}" + echo "Usage: $0 {start|stop|force-reload|restart|reload|status|reset}" exit 1 ;; esac -- cgit v1.2.3-54-g00ecf