I have a Java application, to start it I use
java -jar myapp.jar
To stop it I use CTRL+C.
Now I need to convert that application to something that I can start with:
/etc/init.d/myapp start
And I can stop with:
/etc/init.d/myapp stop
The problem is all about saving the PID of the process, I think I saw somewhere a recipe for doing this, I don't remember where and I'm not able to find it.
I saw that there is a project called Java Server Wrapper, but I look for something free that does not limit memory usage. And I think that this work could be done in a single bash script.