I have two CentOS (5) servers with nearly identical specs. When I login and do:

ulimit -u

on one machine, I get

unlimited

and on the other,

77824 

When I run a cron like

* * * * * ulimit -u > ulimit.txt

I get the same results (unlimited, 77824).

I am trying to determine where these are set so that I can alter them. They are not set in any of my profiles (.bashrc, /etc/profile, etc .. these wouldn't affect cron anyway) nor in /etc/security/limits.conf (which is empty). I have scoured google and even gone so far as to do

grep -Ir 77824 /

but nothing has turned up so far. I don't understand how these machines could have come preset with different limits.

I am actually wondering not for these machines, but for a different (CentOS 6) machine which has a limit of 1024, which is far too small. I need to run cron jobs with a higher limit and the only way I know how to set that is in the cron job itself. That's ok, but I'd rather set it system wide so it's not as hacky.

Thanks for any help. This seems like it should be easy (NOT)


EDIT -- SOLVED

Ok, I figured this out. It seems to be an issue either with CentOS 6 or perhaps my machine configuration. On the CentOS 5 configuration, I can set in /etc/security/limits.conf:

* - nproc unlimited

and that would effectively update the accounts and cron limits. However, this does not work in my CentOS 6 box. Instead, I must do:

myname1 - nproc unlimited  
myname2 - nproc unlimited
...

And things work as expected. Maybe the UID specification works to, but the wildcard (*) definitely DOES NOT here. Oddly, wildcards DO work for the 'nofile' limit.

I still would love to know where the default values are actually coming from, because by default, this file is empty and I couldn't see why I had different defaults for the two CentOS boxes, which had identical hardware and were from the same provider.

link|improve this question
Do you have anything in /etc/security/limits.d/ ? – Patrick Feb 5 at 4:40
No, that dir is empty – nomercysir Feb 5 at 5:02
You can post the answer as an actual answer after a certain waiting period. – sysadmin1138 Feb 5 at 12:49
I once looked this up somewhere. The defaults are set by the kernel. Partly hard-coded, partly dependent on the available ram. I think I found that on Oracle Metalink in the context of setting up SLES10 for Oracle-DB 11.2 – Nils Feb 9 at 21:55
feedback

1 Answer

It appears to be /etc/security/limits.conf

http://ss64.com/bash/limits.conf.html

link|improve this answer
I mentioned that in my post already. It has no effect, nor are those values (unlimited, 77824) set there for the respective machines (that file is empty). – nomercysir Feb 5 at 4:36
oh i saw you checked the .bashrc etc. but didn't see you mentioned this one too. – Puddingfox Feb 5 at 5:00
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.