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-ceilometer | |
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-ceilometer')
-rw-r--r-- | meta-openstack/recipes-devtools/python/python-ceilometer/ceilometer.init | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/meta-openstack/recipes-devtools/python/python-ceilometer/ceilometer.init b/meta-openstack/recipes-devtools/python/python-ceilometer/ceilometer.init index d3c72e4..ba0f426 100644 --- a/meta-openstack/recipes-devtools/python/python-ceilometer/ceilometer.init +++ b/meta-openstack/recipes-devtools/python/python-ceilometer/ceilometer.init | |||
@@ -70,6 +70,24 @@ status() | |||
70 | echo "$DESC is not running" | 70 | echo "$DESC is not running" |
71 | } | 71 | } |
72 | 72 | ||
73 | reset() | ||
74 | { | ||
75 | stop | ||
76 | |||
77 | # This is to make sure postgres is configured and running | ||
78 | if ! pidof postmaster > /dev/null; then | ||
79 | /etc/init.d/postgresql-init | ||
80 | /etc/init.d/postgresql start | ||
81 | sleep 2 | ||
82 | fi | ||
83 | [ ! -d /var/log/ceilometer ] && mkdir /var/log/ceilometer | ||
84 | sudo -u postgres dropdb ceilometer | ||
85 | sudo -u postgres createdb ceilometer | ||
86 | ceilometer-dbsync | ||
87 | |||
88 | start | ||
89 | } | ||
90 | |||
73 | case "$1" in | 91 | case "$1" in |
74 | start) | 92 | start) |
75 | start | 93 | start |
@@ -84,8 +102,11 @@ case "$1" in | |||
84 | status) | 102 | status) |
85 | status | 103 | status |
86 | ;; | 104 | ;; |
105 | reset) | ||
106 | reset | ||
107 | ;; | ||
87 | *) | 108 | *) |
88 | echo "Usage: $0 {start|stop|force-reload|restart|reload|status}" | 109 | echo "Usage: $0 {start|stop|force-reload|restart|reload|status|reset}" |
89 | exit 1 | 110 | exit 1 |
90 | ;; | 111 | ;; |
91 | esac | 112 | esac |