LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   -bash: ulimit: open files: cannot modify limit: Operation not permitted (https://www.linuxquestions.org/questions/linux-server-73/bash-ulimit-open-files-cannot-modify-limit-operation-not-permitted-624063/)

pjglinuxq 02-26-2008 07:02 PM

-bash: ulimit: open files: cannot modify limit: Operation not permitted
 
Okay, I know similiar threads have been posted before, but I'm stumped.

Background:
Linux 2.4.21-32.ELsmp
Development server runing Oracle 10.x

We've come across an issue within the Oracle RDBMS Server for which Oracle are recommending changing the following values for the oracle account:
open files from (-n) 65536 to unlimited
stack size from (kbytes, -s) 10240 to unlimited

Current ulimit -a (as oracle):
core file size (blocks, -c) 0
data seg size (kbytes, -d) unlimited
file size (blocks, -f) unlimited
max locked memory (kbytes, -l) 4
max memory size (kbytes, -m) unlimited
open files (-n) 65536
pipe size (512 bytes, -p) 8
stack size (kbytes, -s) unlimited
cpu time (seconds, -t) unlimited
max user processes (-u) 16384
virtual memory (kbytes, -v) unlimited

So, login as oracle, 'ulimit -s unlimited' - no issues, works fine.

However, 'ulimit -n <anything above current limit>' .e.g 'ulimit -n 65537 - give the error '-bash: ulimit: open files: cannot modify limit: Operation not permitted'
'ulimit -n 50000' works okay, as its below the current 65536 limit. If however we then try and raise the limit again e.g 'ulimit -n 50001' - we also receive the same error (even though still below 65536).

/etc/security/limits/conf:
#<domain> <type> <item> <value>
#
#* soft core 0
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1000000
oracle hard nofile 1000000
#* hard rss 10000
#@student hard nproc 20
#@faculty soft nproc 20
#@faculty hard nproc 50
#ftp hard nproc 0
#@student - maxlogins 4
# End of file

/etc/pam.d/login:#%PAM-1.0
auth required pam_securetty.so
auth required pam_stack.so service=system-auth
auth required pam_nologin.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 optional pam_console.so
session required /lib/security/pam_limits.so
# above line added for oracle

Ideas?
Thanks
Paul

gilead 02-26-2008 07:19 PM

You've listed /etc/security/limits/conf as the file - according to what I've seen using google it should be /etc/security/limits.conf. Have you tried it that way?

The info at http://www.akadia.com/services/ora_l...stall_10g.html may help. They also recommend not setting limits to the level of /proc/sys/fs/file-max:
Code:

If you do that and the user uses up all the file handles, then the
system would run out of file handles. This could mean that you won't be
able to initiate new remote logins any more since the system won't be able
to open any PAM modules which are required for performing a login. That's
why we set the hard limit to 63536 and not to 65536.


shogun1234 07-18-2009 12:29 PM

Quote:

Originally Posted by gilead (Post 3070892)
You've listed /etc/security/limits/conf as the file - according to what I've seen using google it should be /etc/security/limits.conf. Have you tried it that way?

The info at http://www.akadia.com/services/ora_l...stall_10g.html may help. They also recommend not setting limits to the level of /proc/sys/fs/file-max:
Code:

If you do that and the user uses up all the file handles, then the
system would run out of file handles. This could mean that you won't be
able to initiate new remote logins any more since the system won't be able
to open any PAM modules which are required for performing a login. That's
why we set the hard limit to 63536 and not to 65536.


I change to use 63536, but I still get the error
Code:

-bash: ulimit: open files: cannot modify limit: Operation not permitted
what else I need to modify?

the /etc/profile is

Code:

if [ $USER = "oracle" ]; then
        if [ $SHELL = "/bin/ksh" ]; then
              ulimit -p 16384
              ulimit -n 63536
        else
              ulimit -u 16384 -n 63536
        fi
        umask 022
fi

/etc/security/limit.conf is

Code:

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


Mapped 06-11-2010 06:19 AM

Make sure you have configued the /etc/pam.d/login correctly

session required /lib64/security/pam_limits.so
or
session required /lib/security/pam_limits.so


All times are GMT -5. The time now is 05:51 AM.