linux下启动和终止JAVA程序shell脚本
1.启动脚本start.sh
#run application backgroud nohup java -jar chess-admin-1.0-SNAPSHOT.jar >/dev/null 2>&1 & #record the process id echo $!>pid
SRE实战 互联网时代守护先锋,助力企业售后服务体系运筹帷幄!一键直达领取阿里云限量特价优惠。
2.终止脚本stop.sh
kill `cat pid`
或者查询pid后终止
kill `jps -l | grep chess-admin | awk '{print $1}'`
或
kill `jps -l |awk '$2~"chess-admin"{print $1}'`

更多精彩