1. 問題の説明
Linux は、root ユーザーから通常ユーザーに切り替えるときにエラーを報告します。
--从root切换到oracle用户
# su - oracle
Last login: Thu Jun 29 16:1:44 CST 2023 on pts/0
su: failed to execute /bin/bash: Resource temporarily unavailable
または、次のエラーが発生します。
# su - oracle
last login: Thu Jun 29 16:13:15 CST 223 on pts/1
bash: fork: retry: No child processes
bash: fork: retry: No child processes
retry: No child processesbash: fork:
bash: fork: retry: No child processes
bash:fork:Resource temporarily unavailable
2. 加工方法
1. /etc/security/limits.d/20-nproc.conf で構成ファイルを変更します。
修正する前に:
# Default limit for number of user's processes to prevent#accidental fork bombs.
# See rhbz #432903 for reasoning.
* soft nproc 4096
root soft nproc unlimited
変更後:
# Default limit for number of user's processes to prevent#accidental fork bombs.
# See rhbz #432903 for reasoning.
* soft nproc 4096
root soft nproc unlimited
2. 設定ファイル /etc/security/limits.conf を変更します。
修正する前に:
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1924
oracle hard nofile 65536
oracle soft stack 1024
0oracle hard stack 32768
変更後:
root soft nofile 65535
root hard nofile 65535
oracle soft nproc 65535
oracle hard nproc 65535
oracle soft nofile 65535
oracle hard nofile 65536
oracle soft stack 10240
0oracle hard stack 32768
構成ファイルを変更した後、再度通常のユーザーに切り替えてみてください。
参考記事:
https://www.cnblogs.com/hsia2017/p/9173543.html
https://www.cnblogs.com/zhaojingyu/p/10929712.html
https://www.xiongtianqi.cn/thread-312313 -1-1.html