summaryrefslogtreecommitdiffstats
path: root/man/zh_CN/man5/limits.5
blob: 1328a85a173b41f4a2982f3c1b8b9acdf03518cf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
'\" t
.\"     Title: limits
.\"    Author: Luca Berra
.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
.\"      Date: 2020-01-23
.\"    Manual: 文件格式和转化
.\"    Source: shadow-utils 4.8.1
.\"  Language: Chinese Simplified
.\"
.TH "LIMITS" "5" "2020-01-23" "shadow\-utils 4\&.8\&.1" "文件格式和转化"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.\" http://bugs.debian.org/507673
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.ie \n(.g .ds Aq \(aq
.el       .ds Aq '
.\" -----------------------------------------------------------------
.\" * 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
The
\fILIMITS_STRING\fR
is a string of a concatenated list of resource limits\&. Each limit consists of a letter identifier followed by a numerical limit\&.
.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: maximum file size (KB)
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
K: file creation mask, set by
\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: process priority, set by
\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
For example,
\fIL2D2048N5\fR
is a valid
\fILIMITS_STRING\fR\&. For reading convenience, the following entries are equivalent:
.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\&. An 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 a user exist, only the first line for this user will be considered\&.
.PP
If no lines are specified for a 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
To completely disable limits for a user, a single dash "\fI\-\fR" will do\&.
.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)\&.