We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
如果 我这个包在一个机器部署多个,只是端口不同,这样的话 kill 会把所有进程都 kill 掉,并不是我期望的那样,我的写法如下 #!/bin/bash jarName='xxxx.jar' port=8085 mainClass='org.xxx.api.Application' #pid=$(ps -ef | grep $jarName | grep -v grep | awk '{print $2}') pid=$(lsof -i:$port | grep -v COMMAND | awk '{print $2}') kill -9 $pid nohup java -cp $jarName:./lib/* -server -Dspring.config.location=file:./config/ -Dserver.port=$port $mainClass & >/dev/null
The text was updated successfully, but these errors were encountered:
No branches or pull requests
如果 我这个包在一个机器部署多个,只是端口不同,这样的话 kill 会把所有进程都 kill 掉,并不是我期望的那样,我的写法如下
#!/bin/bash
jarName='xxxx.jar'
port=8085
mainClass='org.xxx.api.Application'
#pid=$(ps -ef | grep $jarName | grep -v grep | awk '{print $2}')
pid=$(lsof -i:$port | grep -v COMMAND | awk '{print $2}')
kill -9 $pid
nohup java -cp $jarName:./lib/* -server -Dspring.config.location=file:./config/ -Dserver.port=$port $mainClass & >/dev/null
The text was updated successfully, but these errors were encountered: