Re: [Exim] Exim daemon problem; not closing inherited fds

Páxina inicial
Borrar esta mensaxe
Responder a esta mensaxe
Autor: Michael J. Tubby B.Sc \(Hons\) G8TIC
Data:  
Para: exim-users, Steve Haslam
CC: exim-users
Asunto: Re: [Exim] Exim daemon problem; not closing inherited fds
----- Original Message -----
From: "Philip Hazel" <ph10@???>
To: "Steve Haslam" <steve@???>
Cc: <exim-users@???>
Sent: Monday, September 02, 2002 9:05 PM
Subject: Re: [Exim] Exim daemon problem; not closing inherited fds


> On Mon, 2 Sep 2002, Steve Haslam wrote:
>
> > Exim doesn't seem to close open fds when it goes into the background

(i.e.
> > when run as exim -bd). This can cause problems if one of the fds is a

pipe
> > and a parent process is waiting for the pipe to close :(
>
> If I recall correctly, a long time ago Exim did try to close all file
> descriptors. But the only way to do this is along the lines of
>
> for (i = 0; i < max; i++) close(i);
>
> When people ran it on operating systems with very many potential fds, it
> took far too long to start up. So nowadays it just closes 0, 1, and 2.
>
> If anybody can find a convenient, fast, and portable way to close all
> open descriptors, please tell me about it.
>
>



Sounds like the fix is a long-opts "--close-all-fds" allowing the default
behaviour to be the close 0,1,2 and the close-all-fds to be the previous
for(..) loop - this way both camps are catered for...

Mike