open files: cannot modify limit: (ulimit -n) error

Scott Ruckh sruckh at gemneye.org
Wed Jul 26 23:37:54 UTC 2006


I have an Itanium based system running Red Hat Enterprise Linux AS release
4 (Nahant Update 1).

The contents of /proc/sys/fs/file-max is:  1660043

The contents of /etc/security/limits.conf contain:

oracle          soft    nproc   2047
oracle          hard    nproc   16384
oracle          soft    nofile  1024
oracle          hard    nofile  65536
oracle          soft    stack   1024
oracle          hard    stack   32768

The contents of /etc/pam.d/sshd :

#%PAM-1.0
auth       required     pam_stack.so service=system-auth
auth       required     pam_nologin.so
account    required     pam_access.so
account    required     pam_stack.so service=system-auth
password   required     pam_stack.so service=system-auth
session    required     pam_stack.so service=system-auth
session    required     pam_limits.so
session    optional     pam_console.so

If I `sudo su - oracle' and then type:

ulimit -n 65536

I get the following error returned:

-bash: ulimit: open files: cannot modify limit: Operation not permitted

On the other hand, if I am root, and then `su - oracle' and then type
`ulimit -n 65536' the error is not generated, and the open files limit is
set to 65536 as can be seen from the output from `ulimit -a'.

I know the bash man page states the following for the -n switch for ulimit:

-n The maximum number of open file descriptors (most systems do not allow
this value to be set)

Although this may be true, you can see that I was able to use the -n
switch and change the open files from its default value of 1024 to the
hard limit of 65536 set in the limits.conf file.

I have googled and have seen a few posts dealing with this similar issue,
but I have not seen a solution or explanation for the problem.

Does anyone know what is causing this error and how to fix it?

Thanks.
Scott
-- 




More information about the redhat-list mailing list