[Wine] ulimit -n ignored/ Max files reached

Darragh Bailey felix at compsoc.nuigalway.ie
Fri May 15 05:07:44 CDT 2009

On Fri, May 15, 2009 at 04:44:35AM -0500, houkouonchi wrote:
> I am having a problem with running utorrent on wine. After running for a little while I eventually get:
> Error: Too many files open.
> I have set ulimit -n unlimited which gives me:
> Code:
> root@¹óô: 02:43 AM :~# ulimit -n
> 1048576
> root@¹óô: 02:43 AM :~#     
> Also its got plenty of file descriptors so it doesn't seem like wine is truly using up to that amount:
> Code:
> root@¹óô: 02:43 AM :~# cat /proc/sys/fs/file-nr
> 11904   0       2097152
> root@¹óô: 02:43 AM :~#  
> Anyone know what I can do to prevent this error or up the maximum amount of open files wine can have?

Firstly, why are you running anything as root? From the output you have
given, it would be assumed that you were running wine as root, which is
on why this is bad.

and see
on how to fix any problems caused by doing this.

Now back to the immediate problem. It's not clear that you fully
understand how ulimit can be used. When you execute ulimit, you only
change the limits for the current process. In addition you may not 
increase the limits imposed on you by the starting shell if you are only
a normal user (i.e. not root).

The correct way to adjust file limits for users is to take a closer look
at /etc/security/limits.conf and also /etc/initscript (see man 5
initscript). By default /etc/initscript will not exist on most systems.

/etc/security/limits.conf is probably a better choice to tweak this
stuff on a per-user basis, while /etc/initscript is really limited to
doing this on a global basis unless you add quite a bit of scripting.


"Nothing is foolproof to a sufficiently talented fool."

More information about the wine-users mailing list