Operating system CentOS 6.3 Normal, one day log in to the normal user prompts as follows:
-bash:fork:resource temporarily unavailable
Checked online, because the Linux system's file restrictions cause the root user login does not have such a hint.
Then modify the system restriction configuration,/etc/security/limits.conf: as follows
The code is as follows |
Copy Code |
* Soft Nproc 10000 * Hard Nproc 10000 * Soft Nofile 1048576 * Hard Nofile 1048576 |
Verify, but the result is still set invalid
The code is as follows |
Copy Code |
# su-m-C ' ulimit-u ' username |
It is determined that the CentOS 6.x version adds a limited configuration/etc/security/limits.d/90-nproc.conf to ensure that the root user is unrestricted. This configuration overrides the setting of the primary configuration file:
The code is as follows |
Copy Code |
# Default limit for number of user ' s processes to prevent # Accidental fork bombs. # RHBZ #432903 for reasoning. * Soft Nproc 1024 Root Soft Nproc Unlimited |
Solution :
Back up/etc/security/limits.d/90-nproc.conf and then modify the/etc/security/limits.d/90-nproc.conf file in the 1024 line to change 1024 to 10240, the other large number.
code is as follows |
copy code |
# su-m-C" Ulimit-u ' username 10240 |