Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I have a question regarding ulimits. I have a CentOS 6 system and if I issue ‘ulimit –Hn’ I see that the maximum number of open file descriptors is set to 4096.
I tried to see if I could hit this limit so I wrote a small C program that loops through a bunch of files and fopen()’s 5000 of them, the code then waits for user input which it never gets therefore leaving the files open. I managed to run this code and the result of ‘lsof –u myuser | wc –l’ gave me a figure of around 5035.
Shouldn’t I have been prevented from opening this many files by ulimit?
Also, on a CentOS 6/7 system, where does a message get logged to if a process exceeds a ulimit – is it /var/log/secure?
Starting with RHEL6 (and therefore derived distros such as CentOS6) in addition to /etc/security/limits.conf they began using files in /etc/security/limits.d. The latter is a directory and anything setup in that directory overrides what is in limits.conf file.
Specifically they added 90-nproc.conf to limits.d subdirectory so the values it contains are the active ones even though they didn't note this in limits.conf itself as they should have. It caused much gnashing of teeth and still bites people that haven't run across it yet.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.