Received: with ECARTIS (v1.0.0; list netdev); Sun, 30 Jan 2005 22:39:20 -0800 (PST) Received: from www.lanforge.com (ns1.lanforge.com [66.165.47.210]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0V6dFPN015998 for ; Sun, 30 Jan 2005 22:39:16 -0800 Received: from [4.33.45.22] (evrtwa1-ar2-4-33-045-022.evrtwa1.dsl-verizon.net [4.33.45.22]) (authenticated bits=0) by www.lanforge.com (8.12.8/8.12.8) with ESMTP id j0V6w1LH026450 for ; Sun, 30 Jan 2005 22:58:01 -0800 Message-ID: <41FDD292.4070202@candelatech.com> Date: Sun, 30 Jan 2005 22:39:14 -0800 From: Ben Greear Organization: Candela Technologies User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.7.3) Gecko/20041020 X-Accept-Language: en-us, en MIME-Version: 1.0 To: "'netdev@oss.sgi.com'" Subject: FD_CLOEXEC doesn't take affect through a system("foo") call?? Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 1053 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: greearb@candelatech.com Precedence: bulk X-list: netdev Content-Length: 929 Lines: 23 I found a funny thing in the 2.6.9 kernel. Not sure if it only happens here, or if it's even a bug, but it was unexpected to me at least... I have a server that opens a listening socket, and sets the FD_CLOEXEC bit, among other things. Sometime later, it creates a pppd.bash file that just starts pppd in the background. From my main process, I execute the pppd.bash script with the system() command. My expectation is that pppd would be spawned and that it would NOT be also listening on the socket that my main server is using. However, that is not the case: The pppd process has that socket and the rest of the sockets & file-descriptos from the main process open. I can work around this by explicitly forking, closing all FDs > 2, and then running the system call, but is what I am seeing expected behaviour? Thanks, Ben -- Ben Greear Candela Technologies Inc http://www.candelatech.com