Skip to content

Instantly share code, notes, and snippets.

@lsgrep
Created March 7, 2015 10:31
Show Gist options
  • Save lsgrep/069e295c8a45a6d64bc7 to your computer and use it in GitHub Desktop.
Save lsgrep/069e295c8a45a6d64bc7 to your computer and use it in GitHub Desktop.
the ulimit command by default changes the HARD limits, which you (a user) can lower, but cannot raise.
Use the -S option to change the SOFT limit, which can range from 0-{HARD}.
I have actually aliased 'ulimit' to 'ulimit -S', so it defaults to the soft limits all the time.
alias ulimit='ulimit -S'
As for your issue, you're missing a column in your entries in limits.conf
There should be FOUR colums, the first is missing in your example.
* soft nofile 4096
* hard nofile 4096
The first column describes WHO the limit is to apply for. '*' is a wildcard, meaning all users. To raise the limits for root, you have to explicitly enter 'root' instead of '*'.
You also need to edit /etc/pam.d/common-session* and add the following line to the end:
session required pam_limits.so
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment