1

I have my spring boot application, I normally work with wars that I deploy on tomcat, but I want to try this way a little bit more.

My problem is that when I deploy it in a server, and I do

java -jar target/myproject.jar

Works pretty fine, but after a time without use, the shell gets disconnected and soon after it (I believe because the shell) the process stops.

Any idea how to deal with this?

I am using Debian.

Thanks.

jpganz18
  • 5,508
  • 17
  • 66
  • 115
  • 1
    Check out this answer: http://stackoverflow.com/a/21546422/1291150 ... you can write some script around the JAR and launch it as a service. – Bohuslav Burghardt Sep 28 '15 at 11:52
  • I dont understand the answer ... the service is an .sh file? http://stackoverflow.com/questions/11203483/run-a-java-application-as-a-service-on-linux/21283530#21283530 – jpganz18 Sep 28 '15 at 12:09
  • nevermind, I figured out, thanks! – jpganz18 Sep 28 '15 at 12:12

1 Answers1

0

Basically, create a .sh file and set it on /etc/init.d/YOURFILE.sh with the info of this post

Run a Java Application as a Service on Linux

Later just make a /etc/init.d/YOURFILE.sh start and thats it..

Community
  • 1
  • 1
jpganz18
  • 5,508
  • 17
  • 66
  • 115