How to Keep Spring Boot App Running After Closing PuTTY Session Without Using a Linux Service?

Hi Everyone, I'm running a Spring Boot application with an embedded Tomcat server deployed as an executable jar file on a Linux server. I access the server through PuTTY and start the application using
java -jar my-jar.jar
java -jar my-jar.jar
The problem is, when I close the PuTTY session, the embedded Tomcat server and the jar file stop running. The application doesn't produce any specific error messages in this scenario. While I understand running the jar as a Linux service is a solution, I'm interested in exploring other methods to keep the application running continuously, even after closing the PuTTY session. Are there any recommended approaches besides using a service? @Middleware & OS
5 Replies
brotherjoons
brotherjoons•7mo ago
--nohup ?
Marvee Amasi
Marvee Amasi•7mo ago
Sure @brotherjoons you right. Using process management tools like nohup or even screen to run the jar in the background after the PuTTY session closes. @Sterling you should look at this
Sterling
Sterling•7mo ago
Hmmm, will do, will do..Thanks @brotherjoons
brotherjoons
brotherjoons•7mo ago
And then if you need to get back to the app upon reconnecting via putty, you issue - fg <pid>
Sterling
Sterling•7mo ago
Okayy 🙂
Want results from more Discord servers?
Add your server