2
votes

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
3
Your application has not been registered as service. So you can use service command to check the status of your application. For more information check this thread stackoverflow.com/questions/3922554/…Pradeep Kr Kaushal
Thanks for reply.but i still dint get it right. do i need to write extra script for it ? which is not mentioned in spring doc link i cited . so where should i use $nohup java -jar program.jar & this?Sasi Kathimanda
Actually, the spring doc is not very explicit. You also need to do the steps for "systemctl" when using "service". The official documentation for Debian "service" command is clearer: wiki.debian.org/systemd/Services Using spring documentation: docs.spring.io/spring-boot/docs/current/reference/html/…Netsab612

3 Answers

8
votes

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

0
votes

In ubuntu you need reload deamon with sudo systemctl daemon-reload