1 <?xml version="1.0" encoding="UTF-8"?>
3 Copyright (c) 1997 , Luca Berra
4 Copyright (c) 2001 - 2007, Tomasz Kłoczko
5 Copyright (c) 2005 - 2006, Yuri Kozlov
6 Copyright (c) 2005 - 2008, Nicolas François
9 Redistribution and use in source and binary forms, with or without
10 modification, are permitted provided that the following conditions
12 1. Redistributions of source code must retain the above copyright
13 notice, this list of conditions and the following disclaimer.
14 2. Redistributions in binary form must reproduce the above copyright
15 notice, this list of conditions and the following disclaimer in the
16 documentation and/or other materials provided with the distribution.
17 3. The name of the copyright holders or contributors may not be used to
18 endorse or promote products derived from this software without
19 specific prior written permission.
21 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22 ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
24 PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
25 HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
26 SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
27 LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
28 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
29 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
31 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook V4.5//EN"
34 "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
35 <!-- SHADOW-CONFIG-HERE -->
37 <refentry id='limits.5'>
41 <firstname>Luca</firstname>
42 <surname>Berra</surname>
43 <contrib>Creation, 1997</contrib>
46 <firstname>Thomas</firstname>
47 <surname>Kłoczko</surname>
48 <email>kloczek@pld.org.pl</email>
49 <contrib>shadow-utils maintainer, 2000 - 2007</contrib>
52 <firstname>Nicolas</firstname>
53 <surname>François</surname>
54 <email>nicolas.francois@centraliens.net</email>
55 <contrib>shadow-utils maintainer, 2007 - now</contrib>
59 <refentrytitle>limits</refentrytitle>
60 <manvolnum>5</manvolnum>
61 <refmiscinfo class="sectdesc">File Formats and Conversions</refmiscinfo>
62 <refmiscinfo class="source">shadow-utils</refmiscinfo>
63 <refmiscinfo class="version">&SHADOW_UTILS_VERSION;</refmiscinfo>
65 <refnamediv id='name'>
66 <refname>limits</refname>
67 <refpurpose>resource limits definition</refpurpose>
69 <!-- body begins here -->
71 <refsect1 id='description'>
72 <title>DESCRIPTION</title>
74 The <emphasis remap='I'>limits</emphasis> file
75 (<filename>/etc/limits</filename> by default
76 or LIMITS_FILE defined <filename>config.h</filename>) describes
77 the resource limits you wish to impose. It should be owned by
78 root and readable by root account only.
82 By default no quota is imposed on 'root'. In fact, there is no way to
83 impose limits via this procedure to root-equiv accounts (accounts with
87 <para>Each line describes a limit for a user in the form:</para>
90 <emphasis remap='I'>user LIMITS_STRING</emphasis>
93 <para>or in the form:</para>
96 <emphasis remap='I'>@group LIMITS_STRING</emphasis>
100 The <emphasis>LIMITS_STRING</emphasis> is a string of a concatenated
101 list of resource limits. Each limit consists of a letter identifier
102 followed by a numerical limit.
105 <para>The valid identifiers are:</para>
108 <listitem><para>A: max address space (KB)</para></listitem>
109 <listitem><para>C: max core file size (KB)</para></listitem>
110 <listitem><para>D: max data size (KB)</para></listitem>
111 <listitem><para>F: maximum file size (KB)</para></listitem>
112 <listitem><para>K: file creation mask, set by
114 <refentrytitle>umask</refentrytitle><manvolnum>2</manvolnum>
115 </citerefentry>.</para>
117 <listitem><para>I: max nice value (0..39 which translates to
118 20..-19)</para></listitem>
119 <listitem><para>L: max number of logins for this user</para></listitem>
120 <listitem><para>M: max locked-in-memory address space (KB)</para></listitem>
121 <listitem><para>N: max number of open files</para></listitem>
122 <listitem><para>O: max real time priority</para></listitem>
123 <listitem><para>P: process priority, set by
125 <refentrytitle>setpriority</refentrytitle><manvolnum>2</manvolnum>
126 </citerefentry>.</para>
128 <listitem><para>R: max resident set size (KB)</para></listitem>
129 <listitem><para>S: max stack size (KB)</para></listitem>
130 <listitem><para>T: max CPU time (MIN)</para></listitem>
131 <listitem><para>U: max number of processes</para></listitem>
135 For example, <emphasis remap='I'>L2D2048N5</emphasis> is a valid
136 <emphasis>LIMITS_STRING</emphasis>. For reading convenience, the
137 following entries are equivalent:
146 Be aware that after <emphasis remap='I'>username</emphasis> the rest
147 of the line is considered a limit string, thus comments are not
148 allowed. An invalid limits string will be rejected (not considered) by
149 the <command>login</command> program.
153 The default entry is denoted by username "<emphasis>*</emphasis>". If
154 you have multiple <emphasis remap='I'>default</emphasis> entries in
155 your <emphasis>LIMITS_FILE</emphasis>, then the last one will be used
156 as the default entry.
160 The limits specified in the form "<replaceable>@group</replaceable>"
161 apply to the members of the specified
162 <replaceable>group</replaceable>.
166 If more than one line with limits for a user exist, only the first line for
167 this user will be considered.
171 If no lines are specified for a user, the last
172 <replaceable>@group</replaceable> line matching a group whose the
173 user is a member of will be considered, or the last line with
174 default limits if no groups contain the user.
178 To completely disable limits for a user, a single dash
179 "<emphasis>-</emphasis>" will do.
183 To disable a limit for a user, a single dash
184 "<replaceable>-</replaceable>" can be used instead of the numerical
185 value for this limit.
189 Also, please note that all limit settings are set PER LOGIN. They are
190 not global, nor are they permanent. Perhaps global limits will come,
191 but for now this will have to do ;)
195 <refsect1 id='files'>
199 <term><filename>/etc/limits</filename></term>
200 <listitem><para></para></listitem>
205 <refsect1 id='see_also'>
206 <title>SEE ALSO</title>
209 <refentrytitle>login</refentrytitle><manvolnum>1</manvolnum>
212 <refentrytitle>setpriority</refentrytitle><manvolnum>2</manvolnum>
215 <refentrytitle>setrlimit</refentrytitle><manvolnum>2</manvolnum>