How to realize the start and stop of Project Business by springboot main
This article mainly explains "how to realize the start-up and stop of project business by springboot main". Interested friends may wish to take a look. The method introduced in this paper is simple, fast and practical. Next let the editor to take you to learn "springboot main how to achieve the project business start-up and stop" bar!
I. springboot main project starts to run the implementation script
#! / bin/bashPATH_LIB=./libCLASSPATH=./etcJVM_PARAM='-Xms1g-Xmx1g-Xmn128m-Xss1m'RUN_MAIN=com.ds.shorter.HttpShortMainSERVER_NAME=http-shortSERVER_PORT=39020for jar in `ls $PATH_LIB/* .jar`do CLASSPATH= "$CLASSPATH:"$jar" doneexec-a $SERVER_NAME java-server $JVM_PARAM $ARGS-classpath "$CLASSPATH" $RUN_MAIN $SERVER_PORT
2. Springboot main project service backend settings to run implementation scripts
Nohup. / server.sh > null 2 > & 1 &
III. The springboot main project business service stops running the implementation script at the backend
#! / bin/bashecho "Input process name first" NAME='RpcUserMain'echo $NAMEPID= `ps-ef | grep "$NAME" | grep-v "grep" | awk'{print $2} '`echo "PDI = [$PID] -" if [$?-eq 0]; then echo "process id:$PID" else echo "process $NAME not exit" exitfikill-9 ${PID} if [$?-eq 0] Then echo "kill $NAME success" else echo "kill $NAME fail" fiecho "PDI = [$PID]-end-" so far, I believe you have a deeper understanding of "how to achieve project business start-up and stop". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!