site_archiver@lists.apple.com Delivered-To: darwin-dev@lists.apple.com Thread-index: Acky6e67AAcnLIcWR4CLpEBzVDNlmQABASSw Thread-topic: lanuchd questions Truthfully, I'd rather petition Apple to make it a part of launchd. The moment we have dependencies, then we have to worry about cycles (deadlock), deciding what to do if a process that we're dependent on goes down, etc. And, now that I'm thinking about it, there is another cheesy method to handle the problem. Write a script that launchd launches that runs your first program. When that program returns, the script submits the other programs to launchd via 'launchctl submit'. Since we haven't put anything into /Library/LaunchDaemons or the other launchd places, we get the same effect as using /var/run, so everything is always launched in the correct order each time we reboot. Thanks, Cem Karan
-----Original Message----- From: Jordan K. Hubbard [mailto:jkh@apple.com] Sent: Monday, October 20, 2008 3:27 PM To: Dave Zarzycki Cc: Karan, Cem (Civ, ARL/CISD); Darwin Dev; Damien Sorresso Subject: Re: lanuchd questions
On Oct 20, 2008, at 7:04 AM, Dave Zarzycki wrote:
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.
You're right, that's pretty cheesy. :-)
Seems like we keep coming up against this "but I want these jobs to be sequential!" requirement again and again. "In the large" I also agree that sequential job launch is very fragile ("on demand" being so much more forgiving of unanticipated events and configuration changes) but I think there is still a legit need for small groups of things (4-5 items, max) to be able to depend on one another. Sounds like a job for the legendary "launchd helper"! :-)
- Jordan
P.S. If we don't want to write that helper, perhaps we should communicate our thoughts on it to a wider audience and see if someone else does!
_______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-dev mailing list (Darwin-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-dev/site_archiver%40lists.appl... This email sent to site_archiver@lists.apple.com