Craig Bryant cdea9bdcb2 Get initial build to work.
Modified build to work with maven 2

Modified so it will download monasca-common jars
from tarballs.openstack.org if the user is jenkins, otherwise the
user is told to build and install monasca-common

Had to move the source code to the new thresh directory so that a
separate module could do the download before dependencies would
be checked by maven

Had to explicitly set the project name in the control file, not sure
why

Change-Id: Ic4d02478b078aad7c1f0eebda2ea2def8d9edf1a
2014-07-24 15:28:13 -06:00

33 lines
956 B
Bash
Executable File

#! /bin/sh
#### BEGIN INIT INFO
## Provides: mon-thresh
## Required-Start: $nimbus
## Required-Stop:
## Default-Start: 2 3 4 5
## Default-Stop:
## Short-Description: Monitoring threshold engine running under storm
## Description:
#### END INIT INFO
case "$1" in
start)
sudo -Hu thresh /opt/storm/current/bin/storm jar /opt/mon/mon-thresh.jar com.hpcloud.mon.ThresholdingEngine /etc/mon/mon-thresh-config.yml thresh-cluster
;;
stop)
sudo -Hu thresh /opt/storm/current/bin/storm kill thresh-cluster
# The above command returns but actually takes awhile loop watching status
while true; do
sudo -Hu thresh /opt/storm/current/bin/storm list |grep thresh-cluster
if [ $? -ne 0 ]; then break; fi
sleep 1
done
;;
status)
sudo -Hu thresh /opt/storm/current/bin/storm list |grep thresh-cluster
;;
restart)
$0 stop
$0 start
;;
esac