]> granicus.if.org Git - shadow/blob - man/limits.5.xml
* man/login.defs.d/ENVIRON_FILE.xml: Document the format for
[shadow] / man / limits.5.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!--
3    Copyright (c) 2001 - 2007, Tomasz Kłoczko
4    Copyright (c) 2005 - 2006, Yuri Kozlov
5    Copyright (c) 2005 - 2008, Nicolas François
6    All rights reserved.
7   
8    Redistribution and use in source and binary forms, with or without
9    modification, are permitted provided that the following conditions
10    are met:
11    1. Redistributions of source code must retain the above copyright
12       notice, this list of conditions and the following disclaimer.
13    2. Redistributions in binary form must reproduce the above copyright
14       notice, this list of conditions and the following disclaimer in the
15       documentation and/or other materials provided with the distribution.
16    3. The name of the copyright holders or contributors may not be used to
17       endorse or promote products derived from this software without
18       specific prior written permission.
19   
20    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21    ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22    LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
23    PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT
24    HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
25    SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
26    LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27    DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28    THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29    (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30    OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 -->
32 <refentry id='limits.5'>
33   <!-- $Id$ -->
34   <refmeta>
35     <refentrytitle>limits</refentrytitle>
36     <manvolnum>5</manvolnum>
37     <refmiscinfo class="sectdesc">File Formats and Conversions</refmiscinfo>
38   </refmeta>
39   <refnamediv id='name'>
40     <refname>limits</refname>
41     <refpurpose>resource limits definition</refpurpose>
42   </refnamediv>
43   <!-- body begins here -->
44
45   <refsect1 id='description'>
46     <title>DESCRIPTION</title>
47     <para>
48       The <emphasis remap='I'>limits</emphasis> file 
49       (<filename>/etc/limits</filename> by default
50       or LIMITS_FILE defined <filename>config.h</filename>) describes 
51       the resource limits you wish to impose. It should be owned by 
52       root and readable by root account only.
53     </para>
54
55     <para>
56       By default no quota is imposed on 'root'. In fact, there is no way to
57       impose limits via this procedure to root-equiv accounts (accounts with
58       UID 0).
59     </para>
60
61     <para>Each line describes a limit for a user in the form:</para>
62
63     <para>
64       <emphasis remap='I'>user LIMITS_STRING</emphasis>
65     </para>
66
67     <para>
68       The <emphasis>LIMITS_STRING</emphasis> is a string of a concatenated
69       list of resource limits. Each limit consists of a letter identifier
70       followed by a numerical limit.
71     </para>
72
73     <para>The valid identifiers are:</para>
74
75     <itemizedlist>
76       <listitem><para>A: max address space (KB)</para></listitem>
77       <listitem><para>C: max core file size (KB)</para></listitem>
78       <listitem><para>D: max data size (KB)</para></listitem>
79       <listitem><para>F: maximum filesize (KB)</para></listitem>
80       <listitem><para>M: max locked-in-memory address space (KB)</para></listitem>
81       <listitem><para>N: max number of open files</para></listitem>
82       <listitem><para>R: max resident set size (KB)</para></listitem>
83       <listitem><para>S: max stack size (KB)</para></listitem>
84       <listitem><para>T: max CPU time (MIN)</para></listitem>
85       <listitem><para>U: max number of processes</para></listitem>
86       <listitem><para>K: file creation mask, set by
87         <citerefentry>
88           <refentrytitle>umask</refentrytitle><manvolnum>2</manvolnum>
89         </citerefentry>.</para>
90       </listitem>
91       <listitem><para>L: max number of logins for this user</para></listitem>
92       <listitem><para>P: process priority, set by
93         <citerefentry>
94           <refentrytitle>setpriority</refentrytitle><manvolnum>2</manvolnum>
95         </citerefentry>.</para>
96       </listitem>
97       <listitem><para>I: max nice value (0..39 which translates to
98       20..-19)</para></listitem>
99       <listitem><para>O: max real time priority</para></listitem>
100     </itemizedlist>
101
102     <para>
103       For example, <emphasis remap='I'>L2D2048N5</emphasis> is a valid
104       <emphasis>LIMITS_STRING</emphasis>. For reading convenience, the
105       following entries are equivalent:
106     </para>
107
108     <programlisting>
109       username L2D2048N5
110       username L2 D2048 N5
111     </programlisting>
112
113     <para>
114       Be aware that after <emphasis remap='I'>username</emphasis> the rest
115       of the line is considered a limit string, thus comments are not
116       allowed. A invalid limits string will be rejected (not considered) by
117       the <command>login</command> program.
118     </para>
119
120     <para>
121       The default entry is denoted by username "<emphasis>*</emphasis>". If
122       you have multiple <emphasis remap='I'>default</emphasis> entries in
123       your <emphasis>LIMITS_FILE</emphasis>, then the last one will be used
124       as the default entry.
125     </para>
126
127     <para>
128       To completely disable limits for a user, a single dash
129       "<emphasis>-</emphasis>" will do.
130     </para>
131
132     <para>
133       Also, please note that all limit settings are set PER LOGIN. They are
134       not global, nor are they permanent. Perhaps global limits will come,
135       but for now this will have to do ;)
136     </para>
137   </refsect1>
138
139   <refsect1 id='files'>
140     <title>FILES</title>
141     <variablelist>
142       <varlistentry>
143         <term><filename>/etc/limits</filename></term>
144         <listitem><para></para></listitem>
145       </varlistentry>
146     </variablelist>
147   </refsect1>
148
149   <refsect1 id='see_also'>
150     <title>SEE ALSO</title>
151     <para>
152       <citerefentry>
153         <refentrytitle>login</refentrytitle><manvolnum>1</manvolnum>
154       </citerefentry>,
155       <citerefentry>
156         <refentrytitle>setpriority</refentrytitle><manvolnum>2</manvolnum>
157       </citerefentry>,
158       <citerefentry>
159         <refentrytitle>setrlimit</refentrytitle><manvolnum>2</manvolnum>
160       </citerefentry>.
161     </para>
162   </refsect1>
163 </refentry>