On Thu, 2006-04-27 at 21:01 +0200, Olivier Galibert wrote:
On Thu, Apr 27, 2006 at 12:32:01PM -0600, Lamont R. Peterson wrote:
> So, unless they are running their client app as root, ulimit -n will not work.
In fact, no. ulimit is stupid, that's all, in that it changes both
soft and hard limit when going down. But if as root you change the
hard limit to 2048 without touching the soft one then start a user
shell, you'll see that you can raise your limit with ulimit -n 2048,
but if you ever reduce it you can't raise it again.
Ah, that's a gotcha I wasn't aware of. All the more reason to use a
wrapper script. Just up the limit for the app that needs it, so you
never have to decrease it. (Or maybe patch the app to up it itself...)
ulimit changes are only supposed to affect the current process and its
children, right?