Skip to content
7 changes: 7 additions & 0 deletions scouter.server/scripts/env.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env bash

READLINK="`dirname $0`/readlink.sh"
TUNAHOME="`dirname $($READLINK $0/..)`"

JAVAOPTS="-Xmx512m"

20 changes: 20 additions & 0 deletions scouter.server/scripts/readlink.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/usr/bin/env bash

TARGET_FILE=$1

cd `dirname $TARGET_FILE`
TARGET_FILE=`basename $TARGET_FILE`

# Iterate down a (possible) chain of symlinks
while [ -L "$TARGET_FILE" ]
do
TARGET_FILE=`readlink $TARGET_FILE`
cd `dirname $TARGET_FILE`
TARGET_FILE=`basename $TARGET_FILE`
done

# Compute the canonicalized name by finding the physical path
# for the directory we're in and appending the target file.
PHYS_DIR=`pwd -P`
RESULT=$PHYS_DIR/$TARGET_FILE
echo $RESULT
6 changes: 5 additions & 1 deletion scouter.server/scripts/startcon.sh
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
java -Xmx512m -classpath ./boot.jar scouter.boot.Boot ./lib -console
#!/usr/bin/env bash

. $(dirname $0)/env.sh

java -Xmx512m -classpath "$TUNAHOME/boot.jar" scouter.boot.Boot "$TUNAHOME/lib" -console
11 changes: 8 additions & 3 deletions scouter.server/scripts/startup.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
mkdir logs > /dev/null 2>&1
cp nohup.out ./logs/nohup.$(date '+%Y%m%d%H%M%S').out > /dev/null 2>&1
nohup java -Xmx512m -classpath ./boot.jar scouter.boot.Boot ./lib > nohup.out &
#!/usr/bin/env bash

. $(dirname $0)/env.sh

mkdir -p "$TUNAHOME/logs" > /dev/null 2>&1
cp nohup.out "$TUNAHOME/logs/nohup.$(date '+%Y%m%d%H%M%S').out" > /dev/null 2>&1
nohup java $JAVAOPTS -classpath "$TUNAHOME/boot.jar" scouter.boot.Boot "$TUNAHOME/lib" > nohup.out &

echo "Scouter server launching..."
echo "See the nohup.out."
6 changes: 5 additions & 1 deletion scouter.server/scripts/stop.sh
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
rm -f *.scouter
#!/usr/bin/env bash

. $(dirname $0)/env.sh

rm -f "$TUNAHOME/*.scouter"