修复Nginx日志文件过多导致Too many open files错误

Signed-off-by: HITSword <admin@huayizhiyun.com>
master
HITSword 2020-01-17 16:10:42 +08:00
parent e4877e246d
commit bef9a052d1
1 changed files with 7 additions and 0 deletions

View File

@ -20,6 +20,13 @@ function amh_module_install()
if amh_module_status ; then
exit;
else
#Fix 'Too many open files' Error
if ! cat /etc/security/limits.conf | grep -q '* soft nofile 40960'; then
echo '* soft nofile 40960' >> /etc/security/limits.conf;
fi;
if ! cat /etc/security/limits.conf | grep -q '* hard nofile 40960'; then
echo '* hard nofile 40960' >> /etc/security/limits.conf;
fi;
#Delete other version
for module_name in `ls /root/amh/modules/ | grep 'HYProxy' | grep -v 'HYProxy-1.0'`; do
#amh module $module_name uninstall force;