Moved to an init script assuming storm is setup, dropped storm jar from deb

This commit is contained in:
Tim Kuhlman 2014-06-13 10:46:16 -06:00
parent 89eaeec0cc
commit 03a6e0095c
3 changed files with 34 additions and 31 deletions

10
pom.xml
View File

@ -317,14 +317,8 @@
</data>
<data>
<type>file</type>
<src>${project.build.directory}/storm-core-${storm.version}.jar
</src>
<dst>/opt/mon/storm-core-${storm.version}.jar</dst>
</data>
<data>
<type>file</type>
<src>${project.basedir}/src/deb/init/mon-thresh.conf</src>
<dst>/etc/init/mon-thresh.conf</dst>
<src>${project.basedir}/src/deb/init/mon-thresh</src>
<dst>/etc/init.d/mon-thresh</dst>
</data>
<data>
<type>file</type>

32
src/deb/init/mon-thresh Executable file
View File

@ -0,0 +1,32 @@
#! /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 exec /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

View File

@ -1,23 +0,0 @@
# Startup script for the mon-thresh
description "MON threshold engine java app"
start on runlevel [2345]
console log
respawn
setgid thresh
setuid thresh
script
if [ -r /etc/default/mon-thresh ]; then
. /etc/default/mon-thresh
fi
exec /usr/bin/java -Xmx8g -Dlogback.configurationFile=/etc/mon/logback.xml -DLOGDIR=${LOGDIR:-/tmp} -cp "/opt/mon/*" com.hpcloud.mon.ThresholdingEngine /etc/mon/mon-thresh-config.yml mon-thresh local
end script