jmon Well-Known Member Licensed User Longtime User Nov 28, 2016 #1 I have a B4J app that is just an Updater: Code: '1) checks for updated file '2) copy that file and replace the old one '3) run the new file '4) close updater The problem I have is that the new file gets closed when I close the updater. This is because I run the new file with jShell: Code: dim sh as Shell sh.Initialize("", "sudo", Array("java", "-jar", "/home/pi/myUpdatedApp.jar")) sh.run(5000) exitapplication As I understand it, the "myUpdatedApp.jar" is considered as a sub-process of my updater, and when I close the updater, all sub-processes are closed too. I tried adding and ampersand "&" at the end of the args of jShell, but same problem. Is there a way to run jShell in a separate process, an not close the executed app? Thanks for your help Jmon.
I have a B4J app that is just an Updater: Code: '1) checks for updated file '2) copy that file and replace the old one '3) run the new file '4) close updater The problem I have is that the new file gets closed when I close the updater. This is because I run the new file with jShell: Code: dim sh as Shell sh.Initialize("", "sudo", Array("java", "-jar", "/home/pi/myUpdatedApp.jar")) sh.run(5000) exitapplication As I understand it, the "myUpdatedApp.jar" is considered as a sub-process of my updater, and when I close the updater, all sub-processes are closed too. I tried adding and ampersand "&" at the end of the args of jShell, but same problem. Is there a way to run jShell in a separate process, an not close the executed app? Thanks for your help Jmon.
Erel B4X founder Staff member Licensed User Longtime User Nov 28, 2016 #2 Don't confuse threads with processes. Threads are not related here. Check the answer here: https://commons.apache.org/proper/commons-exec/faq.html#killing-child-processes It seems that it should work properly on Linux. How are you starting the updater? Test it without the sudo call. Upvote 0
Don't confuse threads with processes. Threads are not related here. Check the answer here: https://commons.apache.org/proper/commons-exec/faq.html#killing-child-processes It seems that it should work properly on Linux. How are you starting the updater? Test it without the sudo call.
jmon Well-Known Member Licensed User Longtime User Nov 28, 2016 #3 Thank you. It seems that removing sudo fixed the problem Upvote 0