LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Security (http://www.linuxquestions.org/questions/linux-security-4/)
-   -   Confused with limits.conf and lsof (http://www.linuxquestions.org/questions/linux-security-4/confused-with-limits-conf-and-lsof-4175457474/)

visu_kvg 04-09-2013 06:05 AM

Confused with limits.conf and lsof
 
Hi All,

My limits.conf is configured as below.

Code:

xyz soft nproc 20
xyz hard nproc 25
xyz soft nofile 150
xyz hard nofile 200

As per the above config I understand that the user xyz cannot have more than 200 open files. However user xyz exceeded the hard limit without any issues and looks to be having no problems at all.lsof output show more than 200 as below.

Code:

[root@example ~]# lsof -u xyz|wc -l
569

I am running RHEL 5.5. Any help making me understand what I am missing is greatly appreciated!

Thanks

jpollard 04-09-2013 07:56 AM

Did you change the limits while the user was logged in?

I believe you have to have the user log out, and back in for the limits to be applied.

Also check the PAM configuration, and make sure it sets the limits.

chrism01 04-09-2013 08:43 AM

I agree, I don't believe its retrospective, otherwise it would have to start killing of stuff, which would be a bad thing...

visu_kvg 04-09-2013 09:12 AM

Quote:

Originally Posted by jpollard (Post 4928174)
Did you change the limits while the user was logged in?

I believe you have to have the user log out, and back in for the limits to be applied.

Also check the PAM configuration, and make sure it sets the limits.

Thank you for quick reply.
I have rebooted after making changes to limits.conf. Limits are enforced via PAM config.

jpollard 04-09-2013 09:42 AM

so it is fixed now?

visu_kvg 04-10-2013 12:31 AM

Quote:

Originally Posted by jpollard (Post 4928237)
so it is fixed now?

No. It is not fixed yet. However, I found one useful pointer below

http://www.netadmintools.com/part295.html

This answers most of my questions.


All times are GMT -5. The time now is 11:03 AM.