The Problem
When login as oracle user, the following message showed on the console.
-bash: ulimit: max user processes: cannot modify limit:operation not permitted.
The Solution
ulimit option ‘-u‘ which means maximum number of user processes was set to a bigger one directly by adding the following line in the $HOME/.bash_profile.
$ ulimit -u 4096 $ ulimit -u 4096
But originally the maximum number of user processes was set to 1024 in /etc/profile for oracle user.
if [ $USER = "oracle" ]; then ulimit -u 1024 ...... fi
When the option of ulimit ‘-u’ was set in the /etc/profile, it can’t be changed to a bigger one directly by adding ‘ulimit -u 4096’ line in $HOME/.bash_profile.
Note: ulimit option ‘-u ‘ which means the maximum number of user processes can be set from three different places, which are /etc/security/limits.conf, /etc/profile and $HOME/.bash_profile. They have the priority from high to low in order. When setting the ulimit value, we can’t set a bigger value in $HOME/.bash_profile than the value set in /etc/profile as we can’t set a bigger one in /etc/profile than the value set in /etc/security/limits.conf. Otherwise, we could encounter this kind of message.
Removing ulimit entries from .bash_profile
1. Remove ulimit entries from $HOME/.bash_profile file if it exists. For example, remove lines with ulimit set as shown below from the .bash_profile:
ulimit -u 4096
2. Add the relevant entries in /etc/profile as shown below:
if [ $USER = "oracle" ]; then ulimit -u 4096 ...... fi