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.
*
), rebooted, logged to tty1, I got2048
. I logged via slim, got2048
. Rebooted, logged via slim, got2048
. Now I get2048
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!limits.conf
, be applied with a delay (few-reboot delay)?