RE: lanuchd questions
RE: lanuchd questions
- Subject: RE: lanuchd questions
- From: "Karan, Cem (Civ, ARL/CISD)" <email@hidden>
- Date: Mon, 20 Oct 2008 11:09:31 -0400
- Thread-topic: lanuchd questions
Actually, I like that method quite a bit; I can make the first program
run once at launch, and have it store the configuration files it
generates in /var/run. The other scripts can use the PathState key to
watch for the files in /var/run that the first one is generating, which
means that they won't launch until the first program is done. And that
solves all my problems in one go. Thanks!
Thanks,
Cem Karan
> -----Original Message-----
> From: Dave Zarzycki [mailto:email@hidden]
> Sent: Monday, October 20, 2008 10:05 AM
> To: Karan, Cem (Civ, ARL/CISD)
> Cc: email@hidden
> Subject: Re: lanuchd questions
>
> Karen,
>
> A cheesy way to accomplish this goal would be leverage the
> launchd conditional keep alive logic and the fact that
> /var/run is guaranteed to be cleaned at boot. This would
> involve breaking each daemon out into a separate launchd job
> that is conditionally kept alive whenever /
> var/run/my-script-is-done exists. The script on the other
> hand, is also a launchd job, and is kept alive as long as
> /var/run/my-script-is- done does NOT exist. This script MUST
> "touch" /var/run/my-script-is- done to signal launchd to stop
> relaunching the script and begin relaunching the daemons.
>
> For the daemons:
>
> <key>KeepAlive</key>
> <dict>
> <key>PathState</key>
> <dict>
> <key>/var/run/my-script-is-done</key>
> <true/>
> </dict>
> </dict>
>
> For the script:
>
> <key>KeepAlive</key>
> <dict>
> <key>PathState</key>
> <dict>
> <key>/var/run/my-script-is-done</key>
> <false/>
> </dict>
> </dict>
>
>
>
>
> davez
>
>
>
> On Oct 20, 2008, at 4:53 AM, Karan, Cem (Civ, ARL/CISD) wrote:
>
> > I hope this is the right list for these questions, if not,
> please tell
> > me where I should go.
> >
> > I'm working on integrating a set of Linux programs into our
> product on
> > the mac, and, as in any porting job, I'm having certain problems
> > getting everything to work just right. In this case, the Linux
> > application is actually a set of programs, each of which does a
> > different job, in a particular order. The first program
> must be run
> > exactly once, before the other programs are run. It
> creates a set of
> > files that the other programs parse and use while they are
> running.
> > These other programs are effectively daemons (which have a -nofork
> > option, so they will work with launchd), and need to be
> kept alive.
> > This means that I can't just write one script that launches them in
> > order, because then the parameters I pass to launchd will
> either keep
> > the whole script alive, or run it just once. So, what is
> the best way
> > of forcing the scripts to run in the particular order I
> want them to
> > run in?
> >
> > Thanks,
> > Cem Karan
> >
> > _______________________________________________
> > Do not post admin requests to the list. They will be ignored.
> > Darwin-dev mailing list (email@hidden)
> > Help/Unsubscribe/Update your Subscription:
> >
> >
> > This email sent to email@hidden
>
>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden