site_archiver@lists.apple.com Delivered-To: darwin-dev@lists.apple.com In message <7DD9D234-403B-4CAD-8BDC-D49B474F2F48@apple.com>, "Jordan K. Hubbard " writes:
Maybe this whole conversation would be easier if you (and some of the others in this conversation) could more precisely describe just what it is you want launchd to do, rather than making this an ongoing retro argument where we stick on our grey beards and debate the usefulness of StartupItems, /etc/rc.d, SYSV runlevels and so on.
Okay. What I want launchd to do is "handle the dependencies needed to determine when a daemon can be safely launched". I understand that, in the abstract, it might be neat if every program everywhere graciously handled all sorts of service availability. However, that involves a huge amount of duplication of effort, and leaves me with dozens of developers whose code could potentially screw things up in some way. So, it'd be REALLY NICE if launchd provided at least a few basic hooks so that the easy cases would Just Work.
Clearly, launchd is the direction we're headed. Just as clearly (I hope), launchd has the option of creating helpers which keep its internal design clean yet provide various bits of useful functionality. One example of this in action is the interaction between the well-known tcp_wrappers and existing mechanisms like [x] inetd. Rather than jam a whole access control system into inetd, a bright guy named Wietse wisely decided "hey, I'll just write an interposing mechanism that adds all the access control knobs without having to redesign or change inetd in any way" and, what do you know, it worked great.
Good point. Perhaps something like this could be provided AS PART OF THE CORE SYSTEM. What I want, here, is to NOT have a situation where every separate daemon has to actually contain the Mac-specific code to handle its startup dependancies. This is Software Engineering 101: If you're writing the same code several times, you have probably done something wrong.
Similarly, a lot of useful wrappers could be created for launchd, including but not limited to wrappers which allow arbitrary ordering of services through notifications. I was kind of curious as to how hard it might be to write such a thing with notify(3) and it took all of 20 minutes to write a fairly functional ordered-launch wrapper for launchd, so either I'm badly underestimating your needs (hence the question in the first paragraph) or we've spent far too much time discussing and not enough time doing actual engineering during this thread.
Cool. Clean it up, give it a man page, and include it in the system, and we should be all done. That's what I want, at least; I want APPLE to provide the code to handle the fairly basic functionality of "launch this program only when the system can support it", so I don't have to maintain thirty-leven copies of the code which checks for and waits on services. It's not perfect, and there are some real reasons to try to improve handling of absentee services... But it'd be awfully nice to be able to get some work done in the mean time. -s _______________________________________________ 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
participants (1)
-
seebs@plethora.net