From cd367431d880df1d1fe7e5eb4f3a220dd18e401f Mon Sep 17 00:00:00 2001 From: Tim Kuhlman Date: Fri, 25 Jul 2014 13:30:13 -0600 Subject: [PATCH] Updated the startup script so multiple runs of start work properly Change-Id: I3fead8d2795f05648cc796fd6bb714b8267034d9 --- thresh/src/deb/init/mon-thresh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/thresh/src/deb/init/mon-thresh b/thresh/src/deb/init/mon-thresh index 59f837d..f70331f 100755 --- a/thresh/src/deb/init/mon-thresh +++ b/thresh/src/deb/init/mon-thresh @@ -11,7 +11,13 @@ 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 + $0 status + if [ $? -ne 0 ]; then + 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 + else + echo "Mon-thresh is already running" + fi + exit 0 ;; stop) sudo -Hu thresh /opt/storm/current/bin/storm kill thresh-cluster