OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
 
Subject: AW: Too many open files error when sending to large list
From: Walter Obergehrer (wobergehrersz-testsysteme.de)
Date: Fri Aug 25 2000 - 10:03:46 CDT


Hi Lutz,

I did a truss -f -t open,close -o /tmp/x postfix start and I can see that
there are .forward's opened 1023 times, then EMFILE (Too many...) occurs and
then they are closed again:

...
10606: open("/users/mikesch/.forward", O_RDONLY) = 1022
10606: open("/users/mikesch/.forward", O_RDONLY) = 1023
10606: open("/users/mikesch/.forward", O_RDONLY) Err#24 EMFILE
10606: open("/etc/.syslog_door", O_RDONLY) Err#24 EMFILE
10606: open("/var/mail/mikesch.lock", O_WRONLY|O_CREAT|O_EXCL, 0) Err#24
EMFILE
10606: open("private/defer", O_WRONLY|O_NONBLOCK) Err#24 EMFILE
10606: open("/etc/.syslog_door", O_RDONLY) Err#24 EMFILE
10606: open("/etc/.syslog_door", O_RDONLY) Err#24 EMFILE
10606: close(1023) = 0
10606: close(1022) = 0
...

The contents and owner seems ok, I think!?

# cat /users/mikesch/.forward
Mikescht-online.de, \mikesch
# ls -l $_
-rw-r--r-- 1 mikesch other 30 Aug 25 13:41
/users/mikesch/.forward

BTW: There is no problem sending mail to mikesch - except when mikesch is in
a mailing list.

how2goonnow?
/Walter

> On the risk of creating a quite large file:
> Use "trace" or a similar program (depending on your platform), to trace
> all system calls. Whenever a file is being opened, you should see the
> corresponding "open()" call.
> Use it like
> trace -f -o /tmp/tracefile postfix start
> The "trace" command might not return, as children of the "postfix start"
> command are still running, so you might have to use another terminal
> to issue the "postfix stop" command.
>
> Once you have the tracefile, check for "strange" files that are being
> opened or a process that is opening a lot of files but does not close
> them (files are also closed on exit).
>
> Best regards,
> Lutz
> --
> Lutz Jaenicke Lutz.Jaenickeaet.TU-Cottbus.DE
> BTU Cottbus http://www.aet.TU-Cottbus.DE/personen/jaenicke/
> Lehrstuhl Allgemeine Elektrotechnik Tel. +49 355 69-4129
> Universitaetsplatz 3-4, D-03044 Cottbus Fax. +49 355 69-4153
>
>