The jar package in springboot runs in the background

Article directory

method one:

java -jar ./platform-customer.jar #This way, closing the current shell window jar service process will also stop

Method Two:

nohup java -jar ./platform-customer.jar -Xms512M -Xmx512M -Xss256k > /dev/null 2>&1 &
recommend this way. Adding nohup at the front will generate a nohup.out file in the current directory where this command is executed to store logs by default.
But we have configured the log collection and storage location in our jar. Don't want to generate a nohup.out for storage anymore.
Then add > /dev/null. The service runs in the background. And no redundant nohup.out files will be generated. Log storage specified within the service is not affected.

Guess you like

Origin blog.csdn.net/adminstate/article/details/131737693