Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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
like image 536
Sasi Kathimanda Avatar asked Mar 05 '26 11:03

Sasi Kathimanda


2 Answers

Sometimes, you may need to run: sudo systemctl daemon-reload for your new service to be loaded.

like image 103
LivePwndz Avatar answered Mar 08 '26 01:03

LivePwndz


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

like image 42
marok Avatar answered Mar 08 '26 00:03

marok



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!