Re: Several Questions
Re: Several Questions
- Subject: Re: Several Questions
- From: Todd Heberlein <email@hidden>
- Date: Sat, 30 May 2009 19:13:59 -0700
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 (email@hidden)
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:
This email sent to email@hidden