我正在设置几个 ulimit(系统是 rhel 7.5),但我找不到有关type
.从内部/etc/security/limits.conf
我得到该类型可以获取两个值,而在配置示例中该文件包含有 3 个值:
- 柔软的
- 难的
- -(破折号)
在下面文件的示例中@学生有一种类型-。
问题何时-(破折号)用来?
....
#<type> can have the two values:
# - "soft" for enforcing the soft limits
# - "hard" for enforcing hard limits
.....
#<domain> <type> <item> <value>
#* soft core 0
#* hard rss 10000
#@student hard nproc 20
#@faculty soft nproc 20
#@faculty hard nproc 50
#ftp hard nproc 0
#@student - maxlogins 4
.....
答案1
您将在以下位置找到答案人限制.conf
<type>
hard
for enforcing hard resource limits. These limits are set by the superuser and enforced by the Kernel. The user cannot raise his requirement of system resources above such values.
soft
for enforcing soft resource limits. These limits are ones that the user can move up or down within the permitted range by any pre-existing hard limits. The values specified with this token can be thought of as default values, for normal system usage.
-
for enforcing both soft and hard resource limits together.
Note, if you specify a type of '-' but neglect to supply the item and value fields then the module will never enforce any limits on the specified user/group etc. .