aboutsummaryrefslogtreecommitdiffstats
path: root/meta-openstack/recipes-devtools/python/python-ceilometer/ceilometer.init
diff options
context:
space:
mode:
Diffstat (limited to 'meta-openstack/recipes-devtools/python/python-ceilometer/ceilometer.init')
-rw-r--r--meta-openstack/recipes-devtools/python/python-ceilometer/ceilometer.init23
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 d3c72e4a..ba0f426d 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()
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/ceilometer ] && mkdir /var/log/ceilometer
+ sudo -u postgres dropdb ceilometer
+ sudo -u postgres createdb ceilometer
+ ceilometer-dbsync
+
+ start
+}
+
case "$1" in
start)
start
@@ -84,8 +102,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