diff --git a/pom.xml b/pom.xml index 5e5ea0c..4f029d3 100644 --- a/pom.xml +++ b/pom.xml @@ -268,34 +268,6 @@ 6 - - org.apache.maven.plugins - maven-dependency-plugin - 2.8 - - - copy - package - - copy - - - - - org.apache.storm - storm-core - ${storm.version} - jar - false - - - ${project.build.directory} - false - true - - - - jdeb org.vafer @@ -317,14 +289,8 @@ file - ${project.build.directory}/storm-core-${storm.version}.jar - - /opt/mon/storm-core-${storm.version}.jar - - - file - ${project.basedir}/src/deb/init/mon-thresh.conf - /etc/init/mon-thresh.conf + ${project.basedir}/src/deb/init/mon-thresh + /etc/init.d/mon-thresh file diff --git a/src/deb/control/postinst b/src/deb/control/postinst index 51952ef..15d0d58 100755 --- a/src/deb/control/postinst +++ b/src/deb/control/postinst @@ -2,6 +2,7 @@ case "$1" in configure) + chmod +x /etc/init.d/mon-thresh if ! [ `getent passwd thresh` ]; then adduser --system --group thresh fi diff --git a/src/deb/init/mon-thresh b/src/deb/init/mon-thresh new file mode 100755 index 0000000..59f837d --- /dev/null +++ b/src/deb/init/mon-thresh @@ -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 /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 diff --git a/src/deb/init/mon-thresh.conf b/src/deb/init/mon-thresh.conf deleted file mode 100644 index 50564bd..0000000 --- a/src/deb/init/mon-thresh.conf +++ /dev/null @@ -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 - - -