Cannot set user ID: Resource temporarily unavailable

Source: Internet
Author: User
Tags metalink

A while ago, infra reported that the database server could not be connected through putty and securecrt. The error message is resource temporarily unavailable. Since there are almost 20 nstance on the server, it should be beyond the value currently set by the system. I have encountered this error before, but it is not this error, but open files: cannot modify limit: operation not permitted. The following describes the error "resource temporarily unavailable" and related information.

 

I. Fault symptom
[Email protected] _ 02: ~> PS-u Oracle | WC-l
2015
[Email protected] _ 02: ~> Lsof | grep Oracle | WC-l
83646
[Email protected] _ 02: ~> Su-Oracle
Password:
Su: cannot set user ID: Resource temporarily unavailable

# The following error occurs when you connect from putty or securecrt:
Server sent disconnect message
Type 2 (Protocol Error ):
"Fork failed: Resource temporarily unavailable"

# System logs are as follows:
Aug 19 09:25:01 linux_02/usr/sbin/cron [6736]: (Oracle) Mail (mailed 25 bytes of output butgot status 0x0001)
Aug 19 09:26:29 linux_02 sshd [6864]: accepted keyboard-interactive/PAM for Oracle from 192.168.9.1 port 1253 SSH2
Aug 19 09:26:29 linux_02 sshd [6875]: Fatal: setresuid 2000: Resource temporarily unavailable
Aug 19 09:27:15 linux_02 sshd [6922]: accepted keyboard-interactive/PAM for Oracle from 192.168.9.1 port 1312 SSH2
Aug 19 09:27:15 linux_02 sshd [6985]: Fatal: setresuid 2000: Resource temporarily unavailable

 

Ii. Fault Analysis
# The following is the error description of 788064.1 pair of resource temporarily unavailable on Metalink:
The error is different when it is reaching the limit 'open files' and 'max user processs' in/etc/profile.

A). Error on reaching the limit 'open files ':

[[Email protected] ~] $ SSH rac2
[Email protected]'s password:
-Bash: ulimit: Max user processes: cannot modify limit: operation not permitted
-Bash:/home/Oracle/. bash_profile: Too program open files

B). Error on reaching the limit 'max user processs ':

[[Email protected] ~] $ SSH [email protected]
[Email protected]'s password:
-Bash: ulimit: open files: cannot modify limit: operation not permitted
-Bash: fork: Resource temporarily unavailable

# That is to say, our current error is caused by the number of processes. # Author: leshami
# Check the current limits. conf configuration below # blog: http://blog.csdn.net/leshami
Linux_02:/etc/security # grep-V ^ #/etc/security/limits. conf

Oracle soft nproc 2047
Hard nproc 16384
Oracle soft nofile 1024
Oracle hard nofile 65536

# The following is an official SuSE Resolution:
The affected user has reached the maximum number of process specified for him into the file/etc/security/limits. conf.

These commands, executed as root, can give you the number of process and of open files for the given user:

PS-u username | WC-l

Lsof | grep username | WC-l

To fix the issue increase the nproc soft limit according to the user and applications needs; please look at the note below about the/etc/security/limits. conf file.
# The above description also adds the nproc value,
# From the PS and lsof commands used earlier, the number of processes of oracle users obtained by the ps command is 2015. From this value, the current configuration meets the requirements.
# The number of opened files exceeds the set hard value, which is 83682. I wonder if the number of files is incorrect, but the number of processes is incorrect.


# ID 788064.1 provides the following solution:
A). Modify/etc/security/limits. conf manually
Increase the value of 'soft nofile' until it is equal to 'hard nofile' value. Increase the value of 'soft nproc' until it is equal to 'hard nproc' value.
# Add the soft nofile value to the hard nofile value; Add the soft nproc value to the hard nproc value.
# From this point of view, the soft value should be allocated once the system starts, but the maximum value cannot exceed the hard value. A soft value is assigned no matter whether the system is idle or not.

 

B). Install Oracle-validated package to modify/etc/security/limits. conf # Install Oracle-validated to automatically modify limits. conf (applicable to RHEL4 to ol5)
After install the Oracle-validated package, the content of/etc/security/limits. conf is modified.

# The description on Metalink ID 1239915.1 also needs to be adjusted to limits. conf.

Solution

The file/etc/security/limits. conf controls the resource limits for each user.
The nproc value determines how many processes that user is allowed and the nofile value limits the total number of files which may be opened at once.

Increase both the soft and hard limits for the destination user ("oracle" in our example) and save the file.
Activate the changed user limits

These changes take effect only upon login, so out and re-login to activate the changes.

 

Iii. troubleshooting
# Adjust the limits. conf file according to the above Solution
Linux_02:/etc/security # cp limits. conf limits. conf. BK
Linux_02:/etc/security # vi/etc/security/limits. conf
Linux_02:/etc/security # grep-V ^ #/etc/security/limits. conf
Oracle soft nproc 16384
Hard nproc 16384
Oracle soft nofile 65536
Oracle hard nofile 65536

[Email protected] _ 02:/users/Oracle> PS-u Oracle | WC-l
2714
[Email protected] _ 02:/users/Oracle> lsof | grep Oracle | WC-l
110694

 

Iv. References
Ulimit: open files: cannot modify limit: operation not permitted
Docid: 1239915.1.
Docid: 788064.1.

 

Cannot set user ID: Resource temporarily unavailable

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.