mirror of mongrel-development@rubyforge.org (inactive)
 help / color / mirror / Atom feed
From: Jos Backus <jos@catnook.com>
To: mongrel-development@rubyforge.org
Cc: puppet-dev@googlegroups.com
Subject: Mongrel doesn't set close-on-exec on its listen socket
Date: Tue, 22 Jul 2008 09:31:04 -0700	[thread overview]
Message-ID: <20080722163104.GA82787@lizzy.catnook.local> (raw)


Mongrel, at least in 1.1.4, doesn't set the close-on-exec flag on the listen
socket. This leads to trouble in programs that use Mongrel and fork other
programs (like puppetmasterd, part of Puppet). For an example, see
http://groups.google.com/group/puppet-dev/browse_thread/thread/463f0f8cfc80cc43

Please consider applying something like the following patch:

--- lib/mongrel.rb.orig 2008-07-17 17:44:42.000000000 -0400
+++ lib/mongrel.rb      2008-07-17 17:44:53.000000000 -0400
@@ -92,7 +92,9 @@

       tries = 0
       @socket = TCPServer.new(host, port)
+      @socket.fcntl(Fcntl::F_SETFD, Fcntl::FD_CLOEXEC)
+
       @classifier = URIClassifier.new
       @host = host
       @port = port

If somebody can show me what the Mongrel way of making this (POSIX)
platform-specific, that would be appreciated.

-- 
Jos Backus
jos at catnook.com

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Puppet Developers" group.
To post to this group, send email to puppet-dev@googlegroups.com
To unsubscribe from this group, send email to puppet-dev-unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/puppet-dev?hl=en
-~----------~----~----~----~------~----~------~--~---

             reply	other threads:[~2008-07-22 16:31 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-22 16:31 Jos Backus [this message]
     [not found] ` <20080722163104.GA82787-/yjMewivvDbpLr52UxKYZsM6rOWSkUom@public.gmane.org>
2008-08-18 21:59   ` Mongrel doesn't set close-on-exec on its listen socket Eric Wong
2008-08-19  3:08     ` [Mongrel-development] " Jos Backus
     [not found]       ` <20080819030844.GA53303-/yjMewivvDbpLr52UxKYZsM6rOWSkUom@public.gmane.org>
2008-08-20  8:27         ` Eric Wong
     [not found]           ` <20080820082737.GA2403-G9TX8C5UF5wdbCeoMzGj59i2O/JbrIOy@public.gmane.org>
2008-11-04 20:41             ` Jos Backus
     [not found]               ` <20081104204159.GA48584-/yjMewivvDbpLr52UxKYZsM6rOWSkUom@public.gmane.org>
2008-11-08  2:15                 ` Eric Wong
replies disabled, historical list

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).