diff options
| author | Amy Fong <amy.fong@windriver.com> | 2014-07-24 13:04:41 -0400 |
|---|---|---|
| committer | Bruce Ashfield <bruce.ashfield@windriver.com> | 2014-07-25 15:45:30 -0400 |
| commit | 1491d54da84195dda8c7d5ce1fac21437f2bc519 (patch) | |
| tree | cc16576ec9471de2c9d18de8987f5a046971df0f /meta-openstack/recipes-devtools/python/python-heat | |
| parent | 3085fa57f54335cfa3794aaf1f45928f5300b000 (diff) | |
| download | meta-cloud-services-1491d54da84195dda8c7d5ce1fac21437f2bc519.tar.gz | |
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 <amy.fong@windriver.com>
Diffstat (limited to 'meta-openstack/recipes-devtools/python/python-heat')
| -rw-r--r-- | meta-openstack/recipes-devtools/python/python-heat/heat.init | 24 |
1 files changed, 23 insertions, 1 deletions
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() | |||
| 76 | echo "$DESC is not running" | 76 | echo "$DESC is not running" |
| 77 | } | 77 | } |
| 78 | 78 | ||
| 79 | reset() | ||
| 80 | { | ||
| 81 | stop | ||
| 82 | |||
| 83 | # This is to make sure postgres is configured and running | ||
| 84 | if ! pidof postmaster > /dev/null; then | ||
| 85 | /etc/init.d/postgresql-init | ||
| 86 | /etc/init.d/postgresql start | ||
| 87 | sleep 2 | ||
| 88 | fi | ||
| 89 | |||
| 90 | [ ! -d /var/log/heat ] && mkdir /var/log/heat | ||
| 91 | sudo -u postgres dropdb heat | ||
| 92 | sudo -u postgres createdb heat | ||
| 93 | heat-manage db_sync | ||
| 94 | |||
| 95 | start | ||
| 96 | } | ||
| 97 | |||
| 79 | case "$1" in | 98 | case "$1" in |
| 80 | start) | 99 | start) |
| 81 | start | 100 | start |
| @@ -90,8 +109,11 @@ case "$1" in | |||
| 90 | status) | 109 | status) |
| 91 | status | 110 | status |
| 92 | ;; | 111 | ;; |
| 112 | reset) | ||
| 113 | reset | ||
| 114 | ;; | ||
| 93 | *) | 115 | *) |
| 94 | echo "Usage: $0 {start|stop|force-reload|restart|reload|status}" | 116 | echo "Usage: $0 {start|stop|force-reload|restart|reload|status|reset}" |
| 95 | exit 1 | 117 | exit 1 |
| 96 | ;; | 118 | ;; |
| 97 | esac | 119 | esac |
