1.start.sh
#!/bin/bash PROJECTDIR=$(cd $(dirname $0)/..; pwd) #启动服务,不打印任何信息 #nohup `which java` -Xms512m -Xmx1024m -XX:PermSize=256m -XX:MaxPermSize=512m -XX:MaxNewSize=512m -Dfile-utf-8 -Dbasir=$PROJECTDIR -Djava.ext.dirs=./../lib:$JAVA-HOME/jre/lib/ext -cp ./../conf:./../lib/server-1.0.0.jar com.zdtech.platform.simserver.SimServer >/dev/null 2>&1 & #启动服务,只打印错误日志 nohup `which java` -Xms512m -Xmx1024m -XX:PermSize=512m -XX:MaxPermSize=512m -XX:MaxNewSize=512m -Dfile-utf-8 -Dbasir=$PROJECTDIR -Djava.ext.dirs=./../lib:$JAVA-HOME/jre/lib/ext -cp ./../conf:./../lib/server-1.0.0.jar com.zdtech.platform.simserver.SimServer >/dev/null 2>nohup.out & PID=$(pgrep -f "Dbasir=$PROJECTDIR") echo "PID:$PID" echo "启动成功... .."
2.stop.sh
#!/bin/bash PROJECTDIR=$(cd $(dirname $0)/..; pwd) PID=$(pgrep -f "Dbasir=$PROJECTDIR") echo "PID: $PID" kill -9 $PID echo "停止成功... ..."