4

I set some values in /etc/security/limits.conf as below:

*   hard    stack   204800
*   hard    nofile  8192

Then rebooted the server. Also I have removed the file /etc/security/limits.d/90-nproc.conf

However, the ulimit command still lists some old/default values:

# ulimit -s
10240
# ulimit -n
1024

I running RHEL 6.2 64-bit

What is wrong here? Is my syntax in limits.conf wrong? Why after server reboot it does not honor limits.conf values?

BTW, I had posted this question earlier on superuser but failed to get the hits, so trying my luck on serverfault.

slayedbylucifer
  • 504
  • 3
  • 7
  • 24

2 Answers2

7

You are changing hard limit values and querying soft limit values. Everything is working fine. Use ulimit -H to view hard limits.

David Schwartz
  • 31,449
  • 2
  • 55
  • 84
1

limmits are loaded upon logon. change

/etc/security/limits.conf

...... logout and log back in.

nandoP
  • 2,021
  • 14
  • 15
  • I had rebooted the server. still the old/default values. – slayedbylucifer Nov 22 '13 at 03:56
  • more details please... * hard stack 204800 * hard nofile 8192 <=== not right – nandoP Nov 22 '13 at 04:00
  • try upping allowed number of processes... nproc – nandoP Nov 22 '13 at 04:16
  • @alayedbylucifer, adn you def logged out of x,... logged back in right? ... strange – nandoP Nov 22 '13 at 04:24
  • TRied `nproc` increase. Still the same old values. In fact `nproc` also lists old value. This ulimit thing is bugging me since last 24 hours and my 10 years of Linux administration experience has gone in the abyss trying to make this work. For whatever reason, NO matter what I put in limits.conf, nothing is honored and it pulls some default values which I do not know where it is coming from. – slayedbylucifer Nov 22 '13 at 04:25
  • well, you can test by fork bomb on a restricted via ulimits account..... try: :(){ :|:& };: – nandoP Nov 22 '13 at 04:26
  • nproc limits number of porcesesses – nandoP Nov 22 '13 at 04:27
  • tried it the fokrbomb as well, but I immediately loose connection to my EC2 instance and then I have reboot it to get it back. The real question is, where `ulimit` command is pulling values from? – slayedbylucifer Nov 22 '13 at 04:28