启动脚本
一. 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]"
- 作者:水岩
- 出处:http://www.cnblogs.com/waterystone
- 本博客中未标明转载的文章归作者水岩和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则保留追究法律责任的权利。
如果您觉得本文对您的学习有所帮助,可通过支付宝(左) 或者 微信(右) 来打赏博主,增加博主的写作动力