'\" t .\" Title: limits .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.75.2 .\" Date: 2012-02-12 .\" Manual: 文件格式和转化 .\" Source: shadow-utils 4.1.5 .\" Language: Chinese Simplified .\" .TH "LIMITS" "5" "2012-02-12" "shadow\-utils 4\&.1\&.5" "文件格式和转化" .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "名称" limits \- 资源限制描述 .SH "描述" .PP The \fIlimits\fR file (/etc/limits by default or LIMITS_FILE defined config\&.h) describes the resource limits you wish to impose\&. It should be owned by root and readable by root account only\&. .PP By default no quota is imposed on \*(Aqroot\*(Aq\&. In fact, there is no way to impose limits via this procedure to root\-equiv accounts (accounts with UID 0)\&. .PP 每行以如下格式对一个用户描述限制: .PP \fIuser LIMITS_STRING\fR .PP 或如下格式: .PP \fI@group LIMITS_STRING\fR .PP \fILIMITS_STRING\fR 是一个串联的资源限制列表。每条限制由一个字母指示符和跟随的数字限制组成。 .PP 可用的指示符有: .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} A:最大地址空间 (KB) .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} C:最大转储文件大小 (KB) .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} D:最大数据大小 (KB) .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} F:最大文件尺寸 (KB) .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} K:文件创建掩码,由 \fBumask\fR(2) 设置。 .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} I:最高 nice 级别,(0\&.\&.\&.39 对应 20\&.\&.\&.\-19) .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} L:此用户的最大登录数 .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} M: max locked\-in\-memory address space (KB) .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} N:最大的文件打开数 .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} O:最大实时优先级 .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} P:进程优先级,由 \fBsetpriority\fR(2) 设置。 .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} R: max resident set size (KB) .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} S:最大栈尺寸 (KB) .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} T:最大 CPU 时间 (分钟) .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} U:最大处理器数目 .RE .PP 例如,\fIL2D2048N5\fR 就是有效的 \fILIMITS_STRING\fR。为了阅读方便,如下项表示同样的意思: .sp .if n \{\ .RS 4 .\} .nf username L2D2048N5 username L2 D2048 N5 .fi .if n \{\ .RE .\} .PP Be aware that after \fIusername\fR the rest of the line is considered a limit string, thus comments are not allowed\&. A invalid limits string will be rejected (not considered) by the \fBlogin\fR program\&. .PP The default entry is denoted by username "\fI*\fR"\&. If you have multiple \fIdefault\fR entries in your \fILIMITS_FILE\fR, then the last one will be used as the default entry\&. .PP The limits specified in the form "\fI@group\fR" apply to the members of the specified \fIgroup\fR\&. .PP If more than one line with limits for an user exist, only the first line for this user will be considered\&. .PP If no lines are specified for an user, the last \fI@group\fR line matching a group whose the user is a member of will be considered, or the last line with default limits if no groups contain the user\&. .PP 要完全禁用对一个用户的限制,可以仅仅只使用一个短线\(lq\-\(rq。 .PP To disable a limit for a user, a single dash "\fI\-\fR" can be used instead of the numerical value for this limit\&. .PP Also, please note that all limit settings are set PER LOGIN\&. They are not global, nor are they permanent\&. Perhaps global limits will come, but for now this will have to do ;) .SH "文件" .PP /etc/limits .RS 4 .RE .SH "参见" .PP \fBlogin\fR(1), \fBsetpriority\fR(2), \fBsetrlimit\fR(2)\&.