Search code examples
linuxstartupexecutable-jarrc

rc.local running JAR


I want to execute two JAR files back to back one.jar two.jar

I edited rc.local entries and added

sleep 5
java -jar /path/to/first/one.jar
sleep 10
java -jar /path/to/second/two.jar

only one jar is able to run if i interchange the sequence i.e. for above code one.jar executed with no issue

and for

sleep 10
java -jar /path/to/second/two.jar
sleep 5
java -jar /path/to/first/one.jar

two.jar runs fine

what is wrong with this..?


Solution

  • I found the solution @

    How do I start two different Python scripts with rc.local?

    Just we need to put '&' between two commands.

    java -jar /path/to/second/two.jar &
    java -jar /path/to/first/one.jar