Request 285 was acted upon.
_________________________________________________________________________
URL: https://rt.openpkg.org/id/285
Ticket: [OpenPKG #285]
Subject: postfix/ulimit vs. fsl/file channel
Requestors: [EMAIL PROTECTED]
Queue: openpkg
Owner: thl
Status: open
Transaction: Correspondence added by thl
Time: Tue Oct 28 11:45:36 2003
________________________________________________________________________
> It is clear that under the circumstances described herein no code that
> is executed after a hard limit was set will ever be able to write a
> file larger than the limit. Even if the code would know about
> ulimit(2) it cannot revert the limit unless it runs as root. This
> affects all code that tries to write to a file and fsl is only one
> victim. The situation is a dead end for the current fsl-1.x
> implementation and is not likely to change soon.
>
> For OpenPKG this means we need to try to tweak the affected postfix
> package to overcome this limitation.
>
Further investigation showed that postfix uses either of ulimit(2) or
setrlimit(2).
All information I found told me that ulimit(2) unconditionally and
irreversibly sets both hard and soft limits. It is assumed that Wietse
opted to set both limits via setrlimit(2) to get the same behavior as
with ulimit(2).
All platforms supported by OpenPKG support and use setrlimit(2) which
could set hard and soft limits separately. So I created a patch that
only sets the soft limit and for every syslog(2) call it saves the
current limits, expands soft limit to the max (hard) and after the call
it reverts to the saved limits. Any failures to tweak the limits are
ignored so in the worst case fallback behavior is identical to current
behavior. The patch is only applied if postfix is build with_fsl.
Please go ahead try the patched postfix [1] in the field with_fsl and
report any problems you encounter. Depending on feedback I'll go and
integrate both this patch and fsl-1.3.0 "monitor" feature into a 1.3 UPD
package .
[1] ftp://ftp.openpkg.org/current/SRC/postfix-2.0.16-20031028.src.rpm
--
Thomas Lotterer
OpenPKG Developer
[EMAIL PROTECTED]
______________________________________________________________________
The OpenPKG Project www.openpkg.org
Bug Database Interface www.openpkg.org/bugdb
Bug Database List [EMAIL PROTECTED]