From 3060c29d9f9dd311d51c8b2b247ec7e5a63f49f0 Mon Sep 17 00:00:00 2001 From: brinn <brinn> Date: Tue, 4 Sep 2007 15:02:16 +0000 Subject: [PATCH] add: datamover.start and datamover.stop to integrate datamover properly in the startup sequence of a server remove: old startup script datamover.sh SVN: 1608 --- datamover/dist/datamover.sh | 3 --- datamover/dist/datamover.start | 18 ++++++++++++++++++ datamover/dist/datamover.stop | 15 +++++++++++++++ 3 files changed, 33 insertions(+), 3 deletions(-) delete mode 100755 datamover/dist/datamover.sh create mode 100755 datamover/dist/datamover.start create mode 100755 datamover/dist/datamover.stop diff --git a/datamover/dist/datamover.sh b/datamover/dist/datamover.sh deleted file mode 100755 index 19c9c2e084d..00000000000 --- a/datamover/dist/datamover.sh +++ /dev/null @@ -1,3 +0,0 @@ -#! /bin/sh - -java -jar lib/datamover.jar "$@" diff --git a/datamover/dist/datamover.start b/datamover/dist/datamover.start new file mode 100755 index 00000000000..9d65f3845ed --- /dev/null +++ b/datamover/dist/datamover.start @@ -0,0 +1,18 @@ +#! /bin/sh + +if [ -f datamover.pid ]; then + PID=`cat datamover.pid` + if [ "$PID" != "" ]; then + if [ `ps -ef |grep $PID |grep -v grep|wc -l` = 1 ] ; then + kill $PID + echo "Already running - killing PID $PID and restarting" + fi + fi + rm datamover.pid +fi + +if [ "$JAVA_HOME" != "" ]; then + JAVA_HOME="$JAVA_HOME/bin/" +fi + +${JAVA_HOME}java -jar lib/datamover.jar "$@" & echo $! > datamover.pid diff --git a/datamover/dist/datamover.stop b/datamover/dist/datamover.stop new file mode 100755 index 00000000000..5f8acb10f1b --- /dev/null +++ b/datamover/dist/datamover.stop @@ -0,0 +1,15 @@ +#! /bin/sh + +if [ -f datamover.pid ]; then + PID=`cat datamover.pid` + if [ `ps -ef |grep $PID |grep -v grep|wc -l` = 0 ] ; then + echo "Program (PID $PID) does not seem to run." + rm datamover.pid + exit 1 + fi + kill `cat datamover.pid` + rm datamover.pid + echo "Killed PID $PID..." +else + echo "No datamover.pid found." +fi -- GitLab