• start.sh
#!/bin/sh
app="client-click.jar"
#nohup java -Xms1g -Xmx3g -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8877 -jar $app >> nohup.out 2>&1 &
nohup java -Xms2g -Xmx8g -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -Xloggc:logs\gc.log -jar $app >> nohup.out 2>&1 &
• restart.sh
#!/bin/sh
app="client-click.jar"
cd /opt/client-click
pid=`ps -ef|grep -v "grep"|grep $app |awk '{print $2}'`
if [ -z $pid ]; then
echo "Service may be already stoped."
else
kill -9 $pid
echo "[STOPED]"
fi
./start.sh
echo "[STARTED]"
• status.sh
#!/bin/sh
app="client-click.jar"
pid=`ps -ef|grep -v "grep"|grep $app |awk '{print $2}'`
if [ -z $pid ]; then
echo "[STOPED]"
else
echo "[RUNNING]"
fi
• stop.sh
#!/bin/sh
app="client-click.jar"
pid=`ps -ef|grep -v "grep"|grep $app |awk '{print $2}'`
if [ -z $pid ]; then
echo "Service may be already stoped. Check the status first." > /dev/stderr;
exit 1;
fi
kill -9 $pid
echo "[STOPED]"