Re: inetdCompatibility
site_archiver@lists.apple.com Delivered-To: darwin-kernel@lists.apple.com Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:mime-version:received:in-reply-to :references:from:date:message-id:subject:to:content-type; bh=AedLEGNZrrUkaO9zjIfHwIEORCC4efRzwHZJYqY8pT8=; b=tN1a/WjsUGif/NKNX1eSXYd4OFyuhzix8mPwCQjch9P12PMeO/ShDq5FZHYNu83o7n ZZnWHA2HL8Zd+SFL8ECPLHlcOqCcRamuCHc4+J2Y/+T/ES+3VlNBU/Lb2aWAV6y7k5pO cTS9U1xrFFXpbCfwJz35sfQ7aqhmTM5e89PdY= Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; b=fr044sXCF/cz4B6l8fJKMRygeciQQgeZlfl53rxZJ4YsrfNeLICVG+t/IRWDsGA1uM obVUaJbUj2D+CVt8rtlGLYUPm5vl+Va6pig+XwPALxX/VOInF2dTNc0ujkqeXAC+qnG6 Y5TDnB5spDAqnuEtKsDDNOylgs7ABo0nP/QuQ= On Thu, Aug 19, 2010 at 11:48 AM, Dreamcat4 <dreamcat4@gmail.com> wrote:
I seem to be confused about what this feature actually does. SSH works because it has a special inetd compatibility flag that will accept stream based socket connections from stdin (as per telnet).
Wheras Nginx is a more streamlined and optimized kind of webserver, which would be too slow for operating in that inetd kind of way. Nginx just wants to be launched and be kept running after the first incoming connection.
However once launchd loads a job with its Sockets listeners definition, it will remain bound to that incoming TCP port on behalf of that launchd job and not let it go.
Im just wondering if its possible to get around all this with a starter script that can trigger nginx to load (on the first incoming connection). The starter script would also have to immediately unload itself from launchd. So as to get launchd to free up the incoming TCP port(s) for nginx. So the very first http connection might have to be dropped, however thats not really such a big problem.
Nginx's launchd plist can be configured to start with KeepAlive => OtherJobEnabled => false. So to say "start up when the triggering job unloads itself".
The triggering job would have to stay unloaded for the remainder of the previous OS session. But can a launchd job be configured to load itself again during the next boot?
It seems the only way to get the above scenario to work. Short of reopening the launchd source code for new functionality / features.
Well, that was easy enough http://gist.github.com/537897 When I do this, launchd does unload the starter job as requested. However it also report the following error to console: Aug 19 13:39:44 janitors-Mac-mini com.apple.launchd.peruser.502[852] (unload): Bug: launchd_core_logic.c:8873 (24108):0 Another thing is that when loading a User-Level job (from ~/Library/LaunchAgents), and specifying: <key>SockServiceName</key> <string>http-alt</string> Launchd reports another error: janitors-Mac-mini:~ id$ launchctl load -w ~/Library/LaunchAgents/unload.plist bind(): Permission denied However "http-alt" is actually port 8080, well above 1024. That doesnt seem right b/c the launchd.plist documentation refers to "Daemon/Agent writers" in the Sockets description. So Launch Agents should be supported.
On Wed, Aug 18, 2010 at 2:59 PM, Dreamcat4 <dreamcat4@gmail.com> wrote:
Hi,
1. There is this patch on the Apple Support forums. Are exporting those environment variables the right way to pass the remote ip information to the spawned process?
http://discussions.apple.com/thread.jspa?messageID=9360848&tstart=0
2. (unrelated to the above patch) Im having trouble with getting the inetdCompatibility feature to work.
The popular example /System/Library/LaunchDaemons/ssh.plist
Which was followed for nginx pretty much verbatem:
Regardless, Launchd isn't starting nginx when a connection is made to http://localhost:8080. The 'http-alt' service is specified in "/etc/services" to point to 8080. So as far as I can see, this should be no different to Launchd than for triggering a start of sshd.
The behaviour is confounding as Apple sshd will work just fine. Flicking inetdCompatibility to Wait => true has no effect either. Nothing.
dreamcat4 dreamcat4@gmail.com
_______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-kernel mailing list (Darwin-kernel@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-kernel/site_archiver%40lists.a... This email sent to site_archiver@lists.apple.com
participants (1)
-
Dreamcat4