Skip to content
Snippets Groups Projects
Commit c36f81e7 authored by Arno Schoenmakers's avatar Arno Schoenmakers
Browse files

Task #9189: Cleanup OTB start scripts (in trunk)

parent 2fe3d678
Branches
Tags
No related merge requests found
...@@ -4737,9 +4737,6 @@ SAS/OTB/OTB/conf/ParmDBConfiguration.xml -text ...@@ -4737,9 +4737,6 @@ SAS/OTB/OTB/conf/ParmDBConfiguration.xml -text
SAS/OTB/OTB/conf/Plotter-config-plottertest.jar -text SAS/OTB/OTB/conf/Plotter-config-plottertest.jar -text
SAS/OTB/OTB/dist-src/OTB -text svneol=unset#text/x-shellscript SAS/OTB/OTB/dist-src/OTB -text svneol=unset#text/x-shellscript
SAS/OTB/OTB/dist-src/OTB.log_prop -text SAS/OTB/OTB/dist-src/OTB.log_prop -text
SAS/OTB/OTB/dist-src/showOTB -text svneol=unset#application/x-shellscript
SAS/OTB/OTB/dist-src/startOTB -text
SAS/OTB/OTB/dist-src/stopOTB -text svneol=unset#application/x-shellscript
SAS/OTB/OTB/doc/OTB.EAP -text SAS/OTB/OTB/doc/OTB.EAP -text
SAS/OTB/OTB/pom.xml -text SAS/OTB/OTB/pom.xml -text
SAS/OTB/OTB/src/nl/astron/lofar/sas/otb/exceptions/ConnectionFailedException.java -text SAS/OTB/OTB/src/nl/astron/lofar/sas/otb/exceptions/ConnectionFailedException.java -text
......
#!/bin/bash
#
# Shop running OTB clients
#
# Usage: showOTB
#
# Author: A.P. Schoenmakers
#
echo "Finding OTB clients:"
user_ports=( `ps -eaf | grep "otb\/client\/" | grep java | awk '{print $1":"$2":"$(NF-4)}'` )
if [ "$user_ports" == "" ]; then
echo "No OTB clients running"
exit
fi
for user_port in "${user_ports[@]}"
do
user=`echo $user_port | awk -F: '{print $1}'`
pid=`echo $user_port | awk -F: '{print $2}'`
port=`echo $user_port | awk -F: '{print $3}'`
echo "Found client using port $port started by user $user with PID $pid"
done
#!/bin/sh
# Check if portnumber is added to commandline; if yes, use it.
if [ -z $1 ]; then
port1=12500
else
port1=$1
fi
echo "Using port $port1 for this client"
export OTB_DIR=/opt/sas/otb/client
export JAVA_HOME=/usr/java/jdk1.7.0_02
echo
echo --- Starting OTB Client ---
otbfile=`ls $OTB_DIR/OTB*.jar | grep -v javadoc | grep -v sources`
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$OTB_DIR
export OTB_APP=$OTB_DIR/`basename $otbfile`
export CLASSPATH=$OTB_APP
for JAR_DEPENDENCY in $OTB_DIR/lib/*.jar
do
echo -- Adding dependency to CLASSPATH: `basename $JAR_DEPENDENCY`
export CLASSPATH=$CLASSPATH:$JAR_DEPENDENCY
done
echo Starting up ...
curdate=`date +%Y%m%dT%H%M%S`
logfile="/localhome/log/OTBClient_${port1}_${curdate}.log"
echo "Logging client logs to file $logfile"
$JAVA_HOME/bin/java -cp $CLASSPATH nl.astron.lofar.sas.otb.Main -s sas001 -p $port1 -d LOFAR_4 -u busyman 2>&1 1>$logfile &
clientpid=$!
echo Started OTB client with PID: $clientpid
#!/bin/bash
#
# Stop running OTB client
#
# Usage: stopOTBServer [<port>]
# where <port> is the portnumber used by the client (default 12500)
#
# Author: A.P. Schoenmakers
if [ -z $1 ]; then
port=12500
else
port=$1
fi
echo "Finding clients using port $port"
client_users=( `ps -eaf | grep "otb\/client\/" | grep java | grep $port | awk '{print $1}'` )
client_pids=( `ps -eaf | grep "otb\/client\/" | grep java | grep $port| awk '{print $2}'` )
if [ ${#client_users[@]} == 0 ]; then
echo "No OTB clients running that use port $port"
exit
else
for client_pid in ${client_pids[@]}
do
echo "Found OTB with PID $client_pid; killing it now"
sudo kill $client_pid
done
fi
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment