什么是“软/硬无文件"?在Linux上的意思 [英] What does "soft/hard nofile" mean on Linux

查看:84
本文介绍了什么是“软/硬无文件"?在Linux上的意思的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我尝试在RedHat EL5上安装软件时,出现错误,软/硬nofile的预期值为4096,而默认值为1024.我设法增加了数量,但是我不知道该怎么办.参数是.他们指的是软链接还是硬链接?

When I tried to install a software on RedHat EL5, I got the error that the expected value of soft/hard nofile is 4096 while the default is 1024. I managed to increase the number, but I don't know what the parameters are. Are they refering to soft link and hard link?

我进行更改的方式是:

A)修改/etc/security/limits.conf

A) modify the /etc/security/limits.conf

user soft nofile 5000
user hard nofile 6000

B)修改/etc/pam.d/system-auth

B) modify the /etc/pam.d/system-auth

session required /lib/security/$ISA/pam_limits.so

C)修改/etc/pam.d/login

C) modify /etc/pam.d/login

session required pam_limits.so

进行更改后(通过切换到root).看来我必须重新启动计算机才能使其生效.但是一些在线帖子说,它应该在进行更改后立即生效.如果有人可以澄清,将不胜感激.

After making the change (by switching to root). It seems that I have to reboot machine to make it effect. But some post online say that it should come to effect right after making the change. Would appreciate if someone can clarify it.

推荐答案

这些是:进程一次打开的文件数的软"和硬"限制.两者都限制相同的资源(与硬链接无关).区别在于:软限制可以在以后以这些限制运行的进程更改为硬限制值,而硬限制只能降低–进程不能通过增加硬限制来为其分配更多资源(运行中的进程除外)具有超级用户权限(以root用户身份).

These are: a 'soft' and a 'hard' limit for number of files a process may have opened at a time. Both limit the same resource (no relation to hard links or anything). The difference is: the soft limit may be changed later, up to the hard limit value, by the process running with these limits and hard limit can only be lowered – the process cannot assign itself more resources by increasing the hard limit (except processes running with superuser privileges (as root)).

可以为其他系统资源设置类似的限制:系统内存,CPU时间等.请参见setrlimit(2)手册页或Shell的ulimit内置命令说明(例如,在bash(1)手册页中)

Similar limits can be set for other system resources: system memory, CPU time, etc. See the setrlimit(2) manual page or the description of your shell's ulimit build-in command (e.g. in the bash(1) manual page.

这篇关于什么是“软/硬无文件"?在Linux上的意思的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆