Shell w/ external applications...

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…

Could folderitem.launch work to start the crashed app instead?

I never even knew that existed… haha! I’ll check it out, thanks Albin!

Apparently it’s not available…

"Launch is not available in console applications. " (under the documentation). Any other suggestions?

Maybe try running the first one in Linux terminal and see why it quits?

I’m having issues with shell.execute and spaces in the path… maybe a similar problem? I’ve fixed it on Linux/mac but windows is being a pain

[quote=131868:@nige cope]Maybe try running the first one in Linux terminal and see why it quits?

I’m having issues with shell.execute and spaces in the path… maybe a similar problem? I’ve fixed it on Linux/mac but windows is being a pain[/quote]

I think the first one exits when its parent process(the app) does.
On Linux and OSX at least there’s nohup you can try.
Command: nohup [command]

PS. Spaces in a shellpath need to be escaped or use Shellpath.

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”) .

Works fine. The launched app does not die.