Name
limits - resource limits definitionDescription
The limits 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.
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).
Each line describes a limit for a user in the form:
user LIMITS_STRING
or in the form:
@group LIMITS_STRING
The LIMITS_STRING is a string of a concatenated list of resource limits. Each limit consists of a letter identifier followed by a numerical limit.
The valid identifiers are: \h'-04'\(bu\h'+03'\c
A: max address space (KB) \h'-04'\(bu\h'+03'\c
C: max core file size (KB) \h'-04'\(bu\h'+03'\c
D: max data size (KB) \h'-04'\(bu\h'+03'\c
F: maximum file size (KB) \h'-04'\(bu\h'+03'\c
K: file creation mask, set by umask(2). \h'-04'\(bu\h'+03'\c
I: max nice value (0..39 which translates to 20..-19) \h'-04'\(bu\h'+03'\c
L: max number of logins for this user \h'-04'\(bu\h'+03'\c
M: max locked-in-memory address space (KB) \h'-04'\(bu\h'+03'\c
N: max number of open files \h'-04'\(bu\h'+03'\c
O: max real time priority \h'-04'\(bu\h'+03'\c
P: process priority, set by setpriority(2). \h'-04'\(bu\h'+03'\c
R: max resident set size (KB) \h'-04'\(bu\h'+03'\c
S: max stack size (KB) \h'-04'\(bu\h'+03'\c
T: max CPU time (MIN) \h'-04'\(bu\h'+03'\c
U: max number of processes
For example, L2D2048N5 is a valid LIMITS_STRING. For reading convenience, the following entries are equivalent:
username L2D2048N5 username L2 D2048 N5
Be aware that after username 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 login program.
The default entry is denoted by username "*". If you have multiple default entries in your LIMITS_FILE, then the last one will be used as the default entry.
The limits specified in the form "@group" apply to the members of the specified group.
If more than one line with limits for a user exist, only the first line for this user will be considered.
If no lines are specified for a user, the last @group 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.
To completely disable limits for a user, a single dash "-" will do.
To disable a limit for a user, a single dash "-" can be used instead of the numerical value for this limit.
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 ;)
Files
/etc/limits
See Also
login(1), setpriority(2), setrlimit(2).