[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: cannot raise the limit of max open files for other users than root



On Wed, 30 May 2018, s7r wrote:

Hello,

Running Debian Stretch here.

I modified /etc/security/limits.conf with limits for soft/hard nofile to
10000 for * (any user), root and my username. Also added session
requried to /etc/pam.d/common-session* files.

Only for root ulimit -Hn or -Sn shown the correct number. For my
username it did not work until I edited /etc/systemd/user.conf and
/etc/systemd/system.conf with the number of max open files I am willing
to allow for this user.

If you had begun this non-root session *before* editing
/etc/security/limits.conf, then you should not have expected

 $ ulimit -Sn

(for example) *in that session* to reflect your edits:

 | $ man 5 limits.conf
 | [...]

 | Also, please note that all limit settings are set per login. They
 | are not global, nor are they permanent; existing only for the
 | duration of the session.

To see the new limits take effect in a session, you would have needed
to log in to that session in *after* making the changes.

For the record, on stretch, here, in tty3:

 $ ulimit -Sn
 1024

And then, in tty2

 # echo '* soft nofile 1025' >> /etc/security/limits.conf

And then again, back in tty3 (without logging out), as documented
above:

 $ ulimit -Sn # No change, no surprise.
 1024

But then, logging out of tty3...

 $ exit

...and logging back in again on tty3 as same regular user:

 $ ulimit -Sn # Change reflected.
 1025

As expected.

Is this a bug or expected behavior? Why doesn't it work from editing
/etc/security/limits.conf?

Maybe it did work exactly as expected. Or maybe it didn't. We need
more information on the sequence of your logins, relative to the
changes to limits.conf, to tell whether the behavior that surprised
you in your non-root session was inconsistent with the documented
behavior.

Thank you.

--

[Redacted] Arrested for [Redacted] Outside [Redacted]: Leeds Crown Court Issues Media Ban

https://archive.is/6Dk1o


Reply to: