Re: CoreFoundation Command Line Tool - an easy beginner question
Re: CoreFoundation Command Line Tool - an easy beginner question
- Subject: Re: CoreFoundation Command Line Tool - an easy beginner question
- From: "Michael Ash" <email@hidden>
- Date: Mon, 4 Aug 2008 20:57:19 -0400
On Mon, Aug 4, 2008 at 5:19 PM, David Duncan <email@hidden> wrote:
> On Aug 4, 2008, at 2:00 PM, Michael Ash wrote:
>
>> I think you may have missed the read() at the beginning of the
>> function, which is critical to the operation of the tool. (The purpose
>> is to wait for the parent process to quit, then restart it.) If,
>> however, I have instead missed a way to make the "open" tool wait for
>> its parent to die before opening the argument, I would very much
>> appreciate enlightenment on that subject.
>
>
> Ah, I think you might want to make the parent process a launchd agent
> instead then. I'm not completely familiar with the intricacies of this (nor
> the problem to be solved in general) but it is capable of relaunching a
> process when necessary, and it will also auto-throttle the relaunch if the
> process is being troublesome (i.e. dying over and over and over in a short
> time).
The scenario I've used it for is for an auto-updating application.
After the new version is put in place, the app needs to restart
itself. The best way to do it that I've found is to spawn a small
subprocess doing something like what this code does, then terminate.
The subprocess then relaunches, and terminates as well. It's not meant
to keep the app running all the time, just manage a single restart, so
it's not quite the same thing that launchd would handle.
Mike
_______________________________________________
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