您的位置:首页 > 其它

启动脚本

2015-12-29 11:01 225 查看

一. 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 -jar $app >> nohup.out 2>&1 &


二. 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]"


四. 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]"
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: