Spring Boot init.d not Not running (process not found)

Tags: , , , ,



I was trying to follow the instructions from here, where trying to run the Spring Boot app as init.d service but could not successfully.

I created the fully executable jar (myapp.jar) as mentioned and also created the symlink to /etc/init.d/myapp When I run the java -jar myapp.jar I could see the application start up successfully.

But when I try to use

service myapp status it says Not running (process not found)

service myapp start it says Failed to start

the documentation says “Assuming that you have a Spring Boot application installed in /var/myapp” I don’t understand this point quite well. I copied the executable jar (via Jenkins) to /var/myapp. so it contains only one file which is jar. does this create the problem?

Any suggestions are appreciated.

Environment:

springBootVersion = '1.3.2.RELEASE'
JDK6 (yes it is)
Ubuntu 12.04

Answer

You must register your jar as service. Look at http://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#deployment-initd-service



Source: stackoverflow