From: Thomas Goirand Date: Mon, 14 Oct 2013 15:52:39 +0000 (+0800) Subject: Added the 2 new services: alarm-evaluator and alarm-notifier. X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=3a23027919c442190bc6ab94afd6eab94c1f3e55;p=openstack-build%2Fceilometer-build.git Added the 2 new services: alarm-evaluator and alarm-notifier. Change-Id: If902c7c64b73724b0eced55d6b576abba72d70b9 Rewritten-From: 18e0c9b847689d4e03ecdf062f2f4d7eeb68219e --- diff --git a/xenial/debian/ceilometer-alarm-evaluator.init b/xenial/debian/ceilometer-alarm-evaluator.init new file mode 100644 index 0000000..39b2031 --- /dev/null +++ b/xenial/debian/ceilometer-alarm-evaluator.init @@ -0,0 +1,106 @@ +#!/bin/sh +### BEGIN INIT INFO +# Provides: ceilometer-alarm-evaluator +# Required-Start: $network $local_fs $remote_fs $syslog +# Required-Stop: $remote_fs +# Should-Start: mongodb rabbitmq-server +# Should-Stop: mongodb rabbitmq-server +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: ceilometer alarm evaluator +# Description: ceilometer alarm evaluator +### END INIT INFO + +# Author: Thomas Goirand + +PATH=/sbin:/usr/sbin:/bin:/usr/bin +DESC="Ceilometer Alarm Evaluator" +SYS_NAME=ceilometer +NAME=ceilometer-alarm-evaluator +DAEMON=/usr/bin/${NAME} + +SCRIPTNAME=/etc/init.d/${NAME} +DAEMON_USER=${SYS_NAME} +DAEMON_GROUP=${SYS_NAME} +LOCK_DIR=/var/lock/${SYS_NAME} +PID_DIR=/var/run/${SYS_NAME} +PID_FILE=${PID_DIR}/${NAME}.pid +LOGFILE=/var/log/${SYS_NAME}/${NAME}.log +DAEMON_ARGS="--config-file=/etc/${SYS_NAME}/ceilometer.conf --log-file=$LOGFILE" + +[ -x $DAEMON ] || exit 0 + +for i in ${LOCK_DIR} ${PID_DIR} ; do + [ ! -d ${i} ] && mkdir -p ${i} + [ -d ${i} ] && chown ${DAEMON_USER}:${DAEMON_GROUP} ${i} +done + +. /lib/lsb/init-functions + +do_start() { + start-stop-daemon --start \ + --background --quiet \ + --chuid ${DAEMON_USER}:${DAEMON_GROUP} \ + --make-pidfile --pidfile ${PID_FILE} \ + --chdir /var/run \ + --startas $DAEMON \ + --test > /dev/null \ + || return 1 + start-stop-daemon --start \ + --background --quiet \ + --chuid ${DAEMON_USER}:${DAEMON_GROUP} \ + --make-pidfile --pidfile ${PID_FILE} \ + --chdir /var/run \ + --startas $DAEMON -- $DAEMON_ARGS \ + || return 2 +} + +do_stop() { + start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --pidfile $PID_FILE + RETVAL=$? + rm -f $PID_FILE + return "$RETVAL" +} + +case "$1" in +start) + log_daemon_msg "Starting $DESC" "$NAME" + do_start + case $? in + 0|1) log_end_msg 0 ;; + 2) log_end_msg 1 ;; + esac +;; +stop) + log_daemon_msg "Stopping $DESC" "$NAME" + do_stop + case $? in + 0|1) log_end_msg 0 ;; + 2) log_end_msg 1 ;; + esac +;; +status) + status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $? +;; +restart|force-reload) + log_daemon_msg "Restarting $DESC" "$NAME" + do_stop + case $? in + 0|1) + do_start + case $? in + 0) log_end_msg 0 ;; + 1) log_end_msg 1 ;; # Old process is still running + *) log_end_msg 1 ;; # Failed to start + esac + ;; + *) log_end_msg 1 ;; # Failed to stop + esac +;; +*) + echo "Usage: $SCRIPTNAME {start|stop|status|restart|force-reload}" >&2 + exit 3 +;; +esac + +exit 0 diff --git a/xenial/debian/ceilometer-alarm-evaluator.install b/xenial/debian/ceilometer-alarm-evaluator.install new file mode 100644 index 0000000..22eb49f --- /dev/null +++ b/xenial/debian/ceilometer-alarm-evaluator.install @@ -0,0 +1 @@ +usr/bin/ceilometer-alarm-evaluator diff --git a/xenial/debian/ceilometer-alarm-evaluator.logrotate b/xenial/debian/ceilometer-alarm-evaluator.logrotate new file mode 100644 index 0000000..23993a3 --- /dev/null +++ b/xenial/debian/ceilometer-alarm-evaluator.logrotate @@ -0,0 +1,7 @@ +/var/log/ceilometer/ceilometer-alarm-evaluator.log { + daily + missingok + compress + delaycompress + notifempty +} diff --git a/xenial/debian/ceilometer-alarm-evaluator.postrm b/xenial/debian/ceilometer-alarm-evaluator.postrm new file mode 100644 index 0000000..99105ef --- /dev/null +++ b/xenial/debian/ceilometer-alarm-evaluator.postrm @@ -0,0 +1,10 @@ +#!/bin/sh + +set -e + +if [ "${1}" = purge ] ; then + rm -f /var/log/ceilometer/ceilometer-alarm-evaluator.log* + [ -d /var/log/ceilometer ] && rmdir --ignore-fail-on-non-empty /var/log/ceilometer +fi + +#DEBHELPER# diff --git a/xenial/debian/ceilometer-alarm-evaluator.upstart.in b/xenial/debian/ceilometer-alarm-evaluator.upstart.in new file mode 100644 index 0000000..d41e565 --- /dev/null +++ b/xenial/debian/ceilometer-alarm-evaluator.upstart.in @@ -0,0 +1,17 @@ +description "ceilometer-alarm-notifier" +author "Thomas Goirand " + +start on runlevel [2345] +stop on runlelvel [016] + +chdir /var/run + +pre-start script + mkdir -p /var/run/ceilometer + chown ceilometer:ceilometer /var/run/ceilometer + + mkdir -p /var/lock/ceilometer + chown ceilometer:ceilometer /var/lock/ceilometer +end script + +exec su -s /bin/sh -c "exec ceilometer-alarm-evaluator --config-file /etc/ceilometer/ceilometer.conf --log-file /var/log/ceilometer/ceilometer-alarm-evaluator.log" ceilometer diff --git a/xenial/debian/ceilometer-alarm-notifier.init b/xenial/debian/ceilometer-alarm-notifier.init new file mode 100644 index 0000000..466b96c --- /dev/null +++ b/xenial/debian/ceilometer-alarm-notifier.init @@ -0,0 +1,106 @@ +#!/bin/sh +### BEGIN INIT INFO +# Provides: ceilometer-alarm-notifier +# Required-Start: $network $local_fs $remote_fs $syslog +# Required-Stop: $remote_fs +# Should-Start: mongodb rabbitmq-server +# Should-Stop: mongodb rabbitmq-server +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: ceilometer alarm notifier +# Description: ceilometer alarm notifier +### END INIT INFO + +# Author: Thomas Goirand + +PATH=/sbin:/usr/sbin:/bin:/usr/bin +DESC="Ceilometer Alarm Notifier" +SYS_NAME=ceilometer +NAME=ceilometer-alarm-notifier +DAEMON=/usr/bin/${NAME} + +SCRIPTNAME=/etc/init.d/${NAME} +DAEMON_USER=${SYS_NAME} +DAEMON_GROUP=${SYS_NAME} +LOCK_DIR=/var/lock/${SYS_NAME} +PID_DIR=/var/run/${SYS_NAME} +PID_FILE=${PID_DIR}/${NAME}.pid +LOGFILE=/var/log/${SYS_NAME}/${NAME}.log +DAEMON_ARGS="--config-file=/etc/${SYS_NAME}/ceilometer.conf --log-file=$LOGFILE" + +[ -x $DAEMON ] || exit 0 + +for i in ${LOCK_DIR} ${PID_DIR} ; do + [ ! -d ${i} ] && mkdir -p ${i} + [ -d ${i} ] && chown ${DAEMON_USER}:${DAEMON_GROUP} ${i} +done + +. /lib/lsb/init-functions + +do_start() { + start-stop-daemon --start \ + --background --quiet \ + --chuid ${DAEMON_USER}:${DAEMON_GROUP} \ + --make-pidfile --pidfile ${PID_FILE} \ + --chdir /var/run \ + --startas $DAEMON \ + --test > /dev/null \ + || return 1 + start-stop-daemon --start \ + --background --quiet \ + --chuid ${DAEMON_USER}:${DAEMON_GROUP} \ + --make-pidfile --pidfile ${PID_FILE} \ + --chdir /var/run \ + --startas $DAEMON -- $DAEMON_ARGS \ + || return 2 +} + +do_stop() { + start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --pidfile $PID_FILE + RETVAL=$? + rm -f $PID_FILE + return "$RETVAL" +} + +case "$1" in +start) + log_daemon_msg "Starting $DESC" "$NAME" + do_start + case $? in + 0|1) log_end_msg 0 ;; + 2) log_end_msg 1 ;; + esac +;; +stop) + log_daemon_msg "Stopping $DESC" "$NAME" + do_stop + case $? in + 0|1) log_end_msg 0 ;; + 2) log_end_msg 1 ;; + esac +;; +status) + status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $? +;; +restart|force-reload) + log_daemon_msg "Restarting $DESC" "$NAME" + do_stop + case $? in + 0|1) + do_start + case $? in + 0) log_end_msg 0 ;; + 1) log_end_msg 1 ;; # Old process is still running + *) log_end_msg 1 ;; # Failed to start + esac + ;; + *) log_end_msg 1 ;; # Failed to stop + esac +;; +*) + echo "Usage: $SCRIPTNAME {start|stop|status|restart|force-reload}" >&2 + exit 3 +;; +esac + +exit 0 diff --git a/xenial/debian/ceilometer-alarm-notifier.install b/xenial/debian/ceilometer-alarm-notifier.install new file mode 100644 index 0000000..c0abb6a --- /dev/null +++ b/xenial/debian/ceilometer-alarm-notifier.install @@ -0,0 +1 @@ +usr/bin/ceilometer-alarm-notifier diff --git a/xenial/debian/ceilometer-alarm-notifier.logrotate b/xenial/debian/ceilometer-alarm-notifier.logrotate new file mode 100644 index 0000000..6f42403 --- /dev/null +++ b/xenial/debian/ceilometer-alarm-notifier.logrotate @@ -0,0 +1,7 @@ +/var/log/ceilometer/ceilometer-alarm-notifier.log { + daily + missingok + compress + delaycompress + notifempty +} diff --git a/xenial/debian/ceilometer-alarm-notifier.postrm b/xenial/debian/ceilometer-alarm-notifier.postrm new file mode 100644 index 0000000..e13d5c4 --- /dev/null +++ b/xenial/debian/ceilometer-alarm-notifier.postrm @@ -0,0 +1,10 @@ +#!/bin/sh + +set -e + +if [ "${1}" = purge ] ; then + rm -f /var/log/ceilometer/ceilometer-alarm-notifier.log* + [ -d /var/log/ceilometer ] && rmdir --ignore-fail-on-non-empty /var/log/ceilometer +fi + +#DEBHELPER# diff --git a/xenial/debian/ceilometer-alarm-notifier.upstart.in b/xenial/debian/ceilometer-alarm-notifier.upstart.in new file mode 100644 index 0000000..8cf8ba0 --- /dev/null +++ b/xenial/debian/ceilometer-alarm-notifier.upstart.in @@ -0,0 +1,17 @@ +description "ceilometer-alarm-notifier" +author "Thomas Goirand " + +start on runlevel [2345] +stop on runlelvel [016] + +chdir /var/run + +pre-start script + mkdir -p /var/run/ceilometer + chown ceilometer:ceilometer /var/run/ceilometer + + mkdir -p /var/lock/ceilometer + chown ceilometer:ceilometer /var/lock/ceilometer +end script + +exec su -s /bin/sh -c "exec ceilometer-alarm-notifier --config-file /etc/ceilometer/ceilometer.conf --log-file /var/log/ceilometer/ceilometer-alarm-notifier.log" ceilometer diff --git a/xenial/debian/ceilometer-common.dirs b/xenial/debian/ceilometer-common.dirs deleted file mode 100644 index bce7e7b..0000000 --- a/xenial/debian/ceilometer-common.dirs +++ /dev/null @@ -1,3 +0,0 @@ -etc/ceilometer -var/lib/ceilometer -var/log/ceilometer diff --git a/xenial/debian/ceilometer-common.install b/xenial/debian/ceilometer-common.install index a6ef61e..1301660 100644 --- a/xenial/debian/ceilometer-common.install +++ b/xenial/debian/ceilometer-common.install @@ -1,2 +1,3 @@ /usr/bin/ceilometer-dbsync +/usr/bin/ceilometer-expirer tools/show_data.py usr/share/doc/ceilometer diff --git a/xenial/debian/changelog b/xenial/debian/changelog index 6ba6140..cd4279f 100644 --- a/xenial/debian/changelog +++ b/xenial/debian/changelog @@ -1,3 +1,9 @@ +ceilometer (2013.2~rc2-2) UNRELEASED; urgency=low + + * Added the 2 new services: alarm-evaluator and alarm-notifier. + + -- Thomas Goirand Mon, 14 Oct 2013 23:52:15 +0800 + ceilometer (2013.2~rc2-1) experimental; urgency=low * New upstream pre-release. diff --git a/xenial/debian/control b/xenial/debian/control index d421ef2..3f809c9 100644 --- a/xenial/debian/control +++ b/xenial/debian/control @@ -119,6 +119,7 @@ Package: ceilometer-common Architecture: all Pre-Depends: dpkg (>= 1.15.6~) Depends: adduser, + dpkg-dev, python-ceilometer (= ${binary:Version}), ${misc:Depends}, ${python:Depends} @@ -202,3 +203,37 @@ Description: OpenStack efficient metering counters system - central agent overall system. . This package contains the central agent. + +Package: ceilometer-alarm-evaluator +Architecture: all +Pre-Depends: dpkg (>= 1.15.6~) +Depends: ceilometer-common (= ${binary:Version}), + ${misc:Depends}, + ${ostack-lsb-base}, + ${python:Depends} +Description: OpenStack efficient metering counters system - alarm evaluator + Ceilometer aims to deliver a Single Point Of Contact for billing systems, + providing all the counters they need to establish customer billing, accros + all current and future OpenStack components. The delivery of counters must be + traceable and auditable, the counters must be easily extensible to support new + projects, and agents doing data collections should be independent of the + overall system. + . + This package contains the alarm evaluator daemon. + +Package: ceilometer-alarm-notifier +Architecture: all +Pre-Depends: dpkg (>= 1.15.6~) +Depends: ceilometer-common (= ${binary:Version}), + ${misc:Depends}, + ${ostack-lsb-base}, + ${python:Depends} +Description: OpenStack efficient metering counters system - alarm notifier + Ceilometer aims to deliver a Single Point Of Contact for billing systems, + providing all the counters they need to establish customer billing, accros + all current and future OpenStack components. The delivery of counters must be + traceable and auditable, the counters must be easily extensible to support new + projects, and agents doing data collections should be independent of the + overall system. + . + This package contains the alarm notifier daemon.