From 03a6e0095c904463d363d8e1e97a16b83ec96954 Mon Sep 17 00:00:00 2001 From: Tim Kuhlman Date: Fri, 13 Jun 2014 10:46:16 -0600 Subject: [PATCH 1/4] Moved to an init script assuming storm is setup, dropped storm jar from deb --- pom.xml | 10 ++-------- src/deb/init/mon-thresh | 32 ++++++++++++++++++++++++++++++++ src/deb/init/mon-thresh.conf | 23 ----------------------- 3 files changed, 34 insertions(+), 31 deletions(-) create mode 100755 src/deb/init/mon-thresh delete mode 100644 src/deb/init/mon-thresh.conf diff --git a/pom.xml b/pom.xml index 93cd261..65ec2c1 100644 --- a/pom.xml +++ b/pom.xml @@ -317,14 +317,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/init/mon-thresh b/src/deb/init/mon-thresh new file mode 100755 index 0000000..1ecf372 --- /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 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 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 - - - From d7c47931fbdadacf5f35d1b5cf22d5b6adeff2f2 Mon Sep 17 00:00:00 2001 From: Tim Kuhlman Date: Fri, 13 Jun 2014 11:46:03 -0600 Subject: [PATCH 2/4] Make the init script executable --- src/deb/control/postinst | 1 + 1 file changed, 1 insertion(+) 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 From ab11ba585938fd7a6c0690c08be1ed62e96d6667 Mon Sep 17 00:00:00 2001 From: Tim Kuhlman Date: Fri, 13 Jun 2014 12:00:24 -0600 Subject: [PATCH 3/4] shell script fixes --- src/deb/init/mon-thresh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/deb/init/mon-thresh b/src/deb/init/mon-thresh index 1ecf372..59f837d 100755 --- a/src/deb/init/mon-thresh +++ b/src/deb/init/mon-thresh @@ -11,14 +11,14 @@ 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 + 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 + if [ $? -ne 0 ]; then break; fi sleep 1 done ;; From 1aaac2e643edfd0b2977e77309a0a18dad6b02b3 Mon Sep 17 00:00:00 2001 From: Tim Kuhlman Date: Mon, 23 Jun 2014 09:42:31 -0600 Subject: [PATCH 4/4] Removed maven-dependency-plugin --- pom.xml | 28 ---------------------------- 1 file changed, 28 deletions(-) diff --git a/pom.xml b/pom.xml index 65ec2c1..6e93813 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