1

I'm using Debian Jessie and I have a strange error connected with setting the limit of open files per process. I want to increase the default limit for certain user (me), so I added to /etc/security/limit.conf:

freyja          soft    nofile          2048
freyja          hard    nofile          2048

I also added to /etc/pam.d/common-session:

session    required   pam_limits.so

Now the limit is increased, but only when I log in the second time. For example, I log into my computer (using slim) after turning it on and I get:

freyja@host01:~$ ulimit -n
256

Then I log out (using i3 exit) and log in again (using slim) and I get:

freyja@host01:~$ ulimit -n
2048

The same would be if after first login I do sudo su freyja. Then logged with su I also get limit of 2048.

Do you have an idea what I should change or could check to make the limit 2048 already during first login?

Edit:

If I raise limit for all users then it works at my first login (this is of course not a satisfactory solution):

*          soft    nofile          2048
*          hard    nofile          2048

So it looks like limit system does not recognize it's me at first login. This is very strange.

4
  • What happens if you login to a TTY first?
    – muru
    Feb 4, 2016 at 9:53
  • I commented lines with wildcard (*), rebooted, logged to tty1, I got 2048. I logged via slim, got 2048. Rebooted, logged via slim, got 2048. Now I get 2048 after every boot, without need to log to tty1. Don't know why it started to work, because the setup is the same as before, but thanks anyway! Feb 4, 2016 at 12:12
  • I'm voting to close this question as off-topic because the problem is no longer reproducible and the question is not likely to be useful for future visitors
    – DavidPostill
    Feb 4, 2016 at 20:25
  • Well, it stopped working again... I don't understand this. Can changes to limits.conf, be applied with a delay (few-reboot delay)? Feb 5, 2016 at 12:13

0

You must log in to answer this question.

Browse other questions tagged .