linux下启动程序和终止程序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

2.终止脚本stop.sh

kill `cat pid`

猜你喜欢

转载自www.cnblogs.com/hdwang/p/9045249.html