17 Sep
2012
17 Sep
'12
6:45 p.m.
On 17.9.2012, at 18.26, Timo Sirainen wrote:
It doesn't work like that with Dovecot. ulimit -u 8192 must be run just before dovecot binary is started. ulimits elsewhere are irrelevant.
Although the strange thing is that Dovecot v2.1 is supposed to automatically increase this limit at startup. Maybe FreeBSD does work in a different way than Linux? The way Linux works (and Dovecot assumes things work) is:
- dovecot master process starts, inheriting the ulimits from the shell that starts it
- Dovecot checks the current limit and increases it if necessary
- Forked child processes inherit the parent's ulimits
- setuid(X) fails if UID X has reached the ulimit value (according the current process's ulimit - not some other value read from somewhere)
There is no reading of X's ulimit value anywhere, it's the same for all Dovecot child processes. limits.conf and such are read and applied by PAM, which is done before 1 step.
kern.maxprocperuid I guess means the upper allowed limit for the ulimit.