I have a console application that runs as a service, and a ‘watchDog’ type application that runs also. Each application monitors the other… and if it finds the other not running, it will launch it. Problem is, it appears the way I have been doing it (in a shell) is not going to work. Here’s the scenario:
App A unexpectedly quits
App B notices this, relaunches App A via Shell
App B unexpectedly quits; but since whatever is opened via a Shell command also dies when out of scope, App A quits too
This scenario leaves both applications dead in the water. I’m using this approach on both Windows and Linux. I haven’t thoroughly tested Linux yet, but on Windows… this is definitely the case. Anybody have any idea how to execute an application externally that isn’t tied to the application that launched it… given the case if the initiating application dies, whatever it launched will still remain running? I could probably find a declare to use, but then I’m left without an option for Linux. Any suggestions would be appreciated…
Thanks guys… I think I got it, with your help. On Linux, I will use nohup as suggested, on Windows I think I can use "start cmd /c “test.exe” (instead of just “test.exe”) .