I created a jar file store.jar and placed it inside: /etc/init.d directory ( I wanted to execute it on startup) I created a script test.sh (inside /etc/init.d) with following code:
java -jar store.jar
After that, I executed:
update-rc.d /etc/init.d/test.sh start 2
by following this thread:
How to run a script at the start up of Ubuntu?
If I execute the script from inside the /etc/init.d directory, it works fine.
/etc/init.d: sh test.sh
Problem 1.
If I'm on a different folder and run test.sh, it says unable to access store.jar
/home/abc: sh /etc/init.d/test.sh
Problem 2.
Nothing happened on ubuntu startup. I mean where can I see the reason why script did not run.
I hope you understand my question. Thanks