site_archiver@lists.apple.com Delivered-To: darwin-dev@lists.apple.com On Jun 3, 2006, at 12:03 PM, seebs@plethora.net (Peter Seebach) wrote: 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. ... and here you make it really clear that you don't get it at all. It already does. Note that your system boots just fine. Sorry, but that's the argument from the launchd side of things. And here you fall back into your retrograde view of things. = Mike _______________________________________________ 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... In message <7DD9D234-403B-4CAD-8BDC-D49B474F2F48@apple.com>, "Jordan K. Hubbard " writes: What I want launchd to do is "handle the dependencies needed to determine when a daemon can be safely launched". In the common case, it already does; I just don't think you understand how. Part of that comes from looking at it the wrong way. It's not a question of "when it can be safely launched", but "when it is needed". It's safe to "launch" something almost anytime; the question is one of ensuring that dependencies are satisfied when they are required. The act of "launching" a daemon requires little more than the executable and a few shared libraries. 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. Let's say that you're launching something that requires a service on port 1234. In the launchd world, you connect to port 1234. That's your service availability check - either you get a connection refusal in which case your depended service is not installed and you can abort right now with an error, or you will block until the service is brought up by launchd, which will have noticed you looking for it. There is no code for you to add. In fact, you can #ifdef out the block of code that looks for the PID file the depended service would otherwise have written, because you don't need it and until you start the service it ain't going to be there anyway. So, it'd be REALLY NICE if launchd provided at least a few basic hooks so that the easy cases would Just Work. 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. 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. Launch the program *whenever*. The system will follow the dependency chain expressed by the program's normal actions as it runs, and bring up the required services. There's nothing you have to add to your program, only the ad-hoc synchronisation that you can *remove*. 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. You can; from everything you've said so far, you are inventing problems that just don't exist. This email sent to site_archiver@lists.apple.com