Sorry about the confusion, yes I meant it will run normally but unattended. I need to make sure it recovers from any errors. in the worst case if it crashes, I need it to launch again automatically, even if there's 1 minute
or whatever delay, it's absolutely fine.

So it is a GUI app that will run unattended, but someone will be logged in at the console?

One approach is to have a very simple, bullet-proof UNIX program that launches the GUI app (via fork()/exec()) and then calls wait() or wait4 (), which should block until the GUI application dies or quits. Then, when wait() returns indicating the GUI program has exited you could check to see if you want to relaunch it again or not.

You could also write a small daemon to be started by launchd at regular intervals (say once a minute, or whatever your threshold is) to look to see if the other program is running, and if it isn't, start it again.

Todd


_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to