ulimit values not being remembered (Ubuntu 11.10)

Hey all, long time since I've been here.

I seem to be having some issues setting the ulimit value for the number of open files on Ubuntu 11.10 (it's an Amazon EC2 instance)

I followed the proccess outlined on this site, by editing /etc/security/limits.conf and adding

* hard nofile 16000
root hard nofile 16000

and editing /etc/pam.d/common-session and placed at the end of the file

session required pam_limits.so

When I rebooted the instance, all users still has the default 1024 for open files. I can manually change it but thats only for that terminal session.

Has anyone come across this before?

Thanks!
Primal

---------- Post updated 02-15-12 at 11:19 AM ---------- Previous update was 02-14-12 at 09:17 PM ----------

Figured it out, I cant just specify a hard limit, I need to set the soft limit as well (that's the value that appears in ulimit -a)

1 Like

From the bash man page, section on ulimit:

If neither -H nor -S is specified, both the soft and hard limits are set. The value of limit
can be a number in the unit specified for the resource or one of the special values hard,
soft, or unlimited, which stand for the current hard limit, the current soft limit, and no limit,
respectively. If limit is omitted, the current value of the soft limit of the resource is
printed, unless the -H option is given.