脚本一:

startTest.sh内容如下:

java -jar Test.jar &
echo $! > /var/run/Test.pid


stopTest.sh内容如下:

PID=$(cat /var/run/Test.pid)
kill -9 $PID

相关文章: