ulimit -n ignored/ Max files reached

Open forum for end-user questions about Wine. Before asking questions, check out the Wiki as a first step.
Forum Rules
Locked
houkouonchi
Level 1
Level 1
Posts: 5
Joined: Fri May 15, 2009 4:41 am

ulimit -n ignored/ Max files reached

Post by houkouonchi »

I am having a problem with running utorrent on wine. After running for a little while I eventually get:

Error: Too many open files.

I have set ulimit -n unlimited which gives me:

Code: Select all

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: Select all

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?
felix
Level 2
Level 2
Posts: 45
Joined: Thu Feb 28, 2008 10:04 am

ulimit -n ignored/ Max files reached

Post by felix »

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
bad.
See
http://wiki.winehq.org/FAQ#head-96bebfa ... 78b0d41014
on why this is bad.

and see
http://wiki.winehq.org/FAQ#head-f60a1ae ... 2b1608f358
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.

--
Darragh

"Nothing is foolproof to a sufficiently talented fool."
houkouonchi
Level 1
Level 1
Posts: 5
Joined: Fri May 15, 2009 4:41 am

Post by houkouonchi »

Ok, so doing:

ulimit -n <value>
then running wine right after that won't work? I also tried putting it in my .bashrc which didn't help either.

I in the past already tried editing /etc/security/limits.conf but it doesn't seem to be making a difference. Even if I run env-update any new shells or anything like that would just use my old limit of 1024. I never had issues like this on rtorrent when I just ran ulimit -n <value> before starting it up but I am guessing wine works differently.

Do you know how I can get the values in /etc/security/limits.conf o take affect without rebooting. I can't reboot this machine.

Thanks for the info!
James Huk

ulimit -n ignored/ Max files reached

Post by James Huk »

2009/5/15 houkouonchi <[email protected]>
Ok, so doing:

ulimit -n <value>
then running wine right after that won't work? I also tried putting it in
my .bashrc which didn't help either.

I in the past already tried editing /etc/security/limits.conf but it
doesn't seem to be making a difference. Even if I run env-update any new
shells or anything like that would just use my old limit of 1024. I never
had issues like this on rtorrent when I just ran ulimit -n <value> before
starting it up but I am guessing wine works differently.

Do you know how I can get the values in /etc/security/limits.conf o take
affect without rebooting. I can't reboot this machine.

Thanks for the info!





I don't know why it didn't work for you - In Debian and Ubuntu - it works
just put something like this in /etc/security/limits.conf:
james hard nofile 655355
of course replace james with your username then re-log
BTW - I don't know why but wine does NOT report this as an error - and IMHO
it should - I had to debug Sonic Riders to find out why it was behaving so
strangly
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.winehq.org/pipermail/wine-us ... chment.htm>
felix
Level 2
Level 2
Posts: 45
Joined: Thu Feb 28, 2008 10:04 am

ulimit -n ignored/ Max files reached

Post by felix »

On Fri, May 15, 2009 at 05:34:53AM -0500, houkouonchi wrote:
Ok, so doing:

ulimit -n <value>
then running wine right after that won't work? I also tried putting it in my .bashrc which didn't help either.

I in the past already tried editing /etc/security/limits.conf but it doesn't seem to be making a difference. Even if I run env-update any new shells or anything like that would just use my old limit of 1024. I never had issues like this on rtorrent when I just ran ulimit -n <value> before starting it up but I am guessing wine works differently.

Do you know how I can get the values in /etc/security/limits.conf o take affect without rebooting. I can't reboot this machine.

Thanks for the info!
You will have to logout completely and restart your session in order for
it to take effect.

To test I would try adding the following to /etc/security/limits.conf
<username> hard nofile 8192


Then after restarting your login session, try the following command
# ulimit -Hn
8192

Worked perfectly fine here for me.


--
Darragh

"Nothing is foolproof to a sufficiently talented fool."
houkouonchi
Level 1
Level 1
Posts: 5
Joined: Fri May 15, 2009 4:41 am

Post by houkouonchi »

Unfortunately editing /etc/security/limits.conf doesn't seem to be doing crap on my machine (gentoo). This is when starting a new X session or ssh session (even after restarting sshd).
felix
Level 2
Level 2
Posts: 45
Joined: Thu Feb 28, 2008 10:04 am

ulimit -n ignored/ Max files reached

Post by felix »

On Fri, May 15, 2009 at 10:11:50AM -0500, houkouonchi wrote:
Unfortunately editing /etc/security/limits.conf doesn't seem
to be doing crap on my machine (gentoo). This is when starting
a new X session or ssh session (even after restarting sshd).
I'll have to check that later at home, not running gentoo at work. I
suspect however that it means that pam isn't configured to use the
limits module.

I would check that the file /etc/pam.d/system-auth contains the
following line:
session required pam_limits.so

Most of the other files should be including the system-auth file.

Otherwise it would mean that pam is not going to read the limits file
when starting any sessions so any changes there will be ignored.


btw, this is getting a little off topic, and you would probably get a
more complete answer from the gentoo forums as this has strayed into the
realm of how to configure pam correctly on gentoo. It's unlikely that
you'll get fully complete answers here. If the above doesn't help you I
would suggest looking at the following:
http://www.gentoo.org/doc/en/security/s ... t=1&chap=7
http://www.gentoo.org/doc/en/security/s ... imits_conf

And if those don't help, you'll really need to post the problem with
adjusting the open file limit in the gentoo forums and solve that
first before trying to get any further help here.

--
Darragh

"Nothing is foolproof to a sufficiently talented fool."
houkouonchi
Level 1
Level 1
Posts: 5
Joined: Fri May 15, 2009 4:41 am

Post by houkouonchi »

Ok, well what I don't get is why isn't manually setting it (for that session) working?

Like open a new terminal then run:

ulimit -n <newlimit>

then in that same session:

wine program.exe

Why would this not work? This worked fine with rtorrent and other software but doesn't seem to be taking affect for wine?
felix
Level 2
Level 2
Posts: 45
Joined: Thu Feb 28, 2008 10:04 am

ulimit -n ignored/ Max files reached

Post by felix »

On Fri, May 15, 2009 at 02:18:54PM -0500, houkouonchi wrote:
Ok, well what I don't get is why isn't manually setting it (for that session) working?

Like open a new terminal then run:

ulimit -n <newlimit>

then in that same session:

wine program.exe

Why would this not work? This worked fine with rtorrent and other software but doesn't seem to be taking affect for wine?
Did you actually confirm that the ulimit change worked? by default for
users it will remain limited to 1024 unless you edited the limits to
allow a user to increase it. And I wouldn't necessary assume that this
actually changed anything to allow other software to work either. There
could be other reasons.

Before this is labeled as a bug in wine, you need to either
a) Confirm that after running 'ulimit -n <newlimit>' for the same user
that you are starting wine with has actually worked
or
b) Increase limits correctly for your user

Run the following just before starting wine:
# ulimit -Hn

P.S. Sorry about taking so long to respond.
--
Darragh

"Nothing is foolproof to a sufficiently talented fool."
Locked