• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: lanuchd questions
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: lanuchd questions


  • Subject: Re: lanuchd questions
  • From: Dave Zarzycki <email@hidden>
  • Date: Mon, 20 Oct 2008 07:04:56 -0700

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
  • Follow-Ups:
    • Re: lanuchd questions
      • From: "Jordan K. Hubbard" <email@hidden>
    • RE: lanuchd questions
      • From: "Karan, Cem (Civ, ARL/CISD)" <email@hidden>
References: 
 >lanuchd questions (From: "Karan, Cem (Civ, ARL/CISD)" <email@hidden>)

  • Prev by Date: lanuchd questions
  • Next by Date: RE: lanuchd questions
  • Previous by thread: lanuchd questions
  • Next by thread: RE: lanuchd questions
  • Index(es):
    • Date
    • Thread