Yearning启停脚本

  • A+
所属分类:linux技术
摘要

路径 /etc/init.d/yearning 

路径 /etc/init.d/yearning

 1 #!/bin/bash  2 # description: yearning Start Stop Restart  3 # processname: yearning  4 # chkconfig: 234 20 80  5   6 CATALINA_HOME=/data/Yearning-go  7   8 case $1 in  9     start) 10         cd $CATALINA_HOME 11         nohup ./Yearning -s >/dev/null 2>&1 & 12         cd 13         ;; 14     stop) 15         ps -e|grep Yearning|awk '{print "kill -9 "$1}'|sh 16         ;; 17     restart) 18         ps -e|grep Yearning|awk '{print "kill -9 "$1}'|sh 19         sleep 1 20         cd $CATALINA_HOME 21         nohup ./Yearning -s >/dev/null 2>&1 & 22         cd 23         ;; 24     *) 25         echo 'please use : Yearning {start | stop | restart}' 26     ;; 27 esac 28 exit 0