Document length limit for the process field in the inittab. Patch
[sysvinit.git] / man / inittab.5
1 '\" -*- coding: UTF-8 -*-
2 .\" Copyright (C) 1998-2001 Miquel van Smoorenburg.
3 .\"
4 .\" This program is free software; you can redistribute it and/or modify
5 .\" it under the terms of the GNU General Public License as published by
6 .\" the Free Software Foundation; either version 2 of the License, or
7 .\" (at your option) any later version.
8 .\"
9 .\" This program is distributed in the hope that it will be useful,
10 .\" but WITHOUT ANY WARRANTY; without even the implied warranty of
11 .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 .\" GNU General Public License for more details.
13 .\"
14 .\" You should have received a copy of the GNU General Public License
15 .\" along with this program; if not, write to the Free Software
16 .\" Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17 .\"
18 .\"{{{}}}
19 .\"{{{ Title
20 .TH INITTAB 5 "Dec 4, 2001" "" "Linux System Administrator's Manual"
21 .\"}}}
22 .\"{{{ Name
23 .SH NAME
24 inittab \- format of the inittab file used by the sysv-compatible init
25 process
26 .\"}}}
27 .\"{{{ Description
28 .SH DESCRIPTION
29 The \fBinittab\fP file describes which processes are started at bootup and
30 during normal operation (e.g.\& /etc/init.d/boot, /etc/init.d/rc, gettys...).
31 .BR Init (8)
32 distinguishes multiple \fIrunlevels\fP, each of which can have its own set of
33 processes that are started. Valid runlevels are \fB0\fP\-\fB6\fP plus
34 \fBA\fP, \fBB\fP, and \fBC\fP for \fBondemand\fP entries. An entry in the
35 \fBinittab\fP file has the following format:
36 .RS
37 .sp
38 \fIid\fP:\fIrunlevels\fP:\fIaction\fP:\fIprocess\fP
39 .sp
40 .RE
41 Lines beginning with `#' are ignored.
42 .\"{{{ id
43 .IP \fIid\fP
44 is a unique sequence of 1-4 characters which identifies an entry in
45 .B inittab
46 (for versions of sysvinit compiled with the \fIold\fP libc5 (< 5.2.18) or
47 a.out libraries the limit is 2 characters).
48 .sp
49 Note: traditionally, for getty and other login processes, the value of the
50 \fIid\fP field is kept the same as the suffix of the corresponding tty, e.g.\&
51 \fB1\fP for \fBtty1\fP. Some ancient login accounting programs might
52 expect this, though I can't think of any.
53 .\"}}}
54 .\"{{{ runlevels
55 .IP \fIrunlevels\fP
56 lists the runlevels for which the specified action should be taken.
57 .\"}}}
58 .\"{{{ action
59 .IP \fIaction\fP
60 describes which action should be taken.
61 .\"}}}
62 .\"{{{ process
63 .IP \fIprocess\fP
64 specifies the process to be executed. If the process field starts with
65 a `+' character,
66 .B init
67 will not do utmp and wtmp accounting for that process. This is needed for
68 gettys that insist on doing their own utmp/wtmp housekeeping. This is also
69 a historic bug. The length of this field is limited to 127 characters.
70 .\"}}}
71 .PP
72 The \fIrunlevels\fP field may contain multiple characters for different
73 runlevels. For example, \fB123\fP specifies that the process should be
74 started in runlevels 1, 2, and 3.
75 The \fIrunlevels\fP for \fBondemand\fP entries may contain an \fBA\fP,
76 \fBB\fP, or \fBC\fP. The \fIrunlevels\fP field of \fBsysinit\fP,
77 \fBboot\fP, and \fBbootwait\fP entries are ignored.
78 .PP
79 When the system runlevel is changed, any running processes that are not
80 specified for the new runlevel are killed, first with \s-2SIGTERM\s0,
81 then with \s-2SIGKILL\s0.
82 .PP
83 Valid actions for the \fIaction\fP field are:
84 .\"{{{ respawn
85 .IP \fBrespawn\fP
86 The process will be restarted whenever it terminates (e.g.\& getty).
87 .\"}}}
88 .\"{{{ wait
89 .IP \fBwait\fP
90 The process will be started once when the specified runlevel is entered and
91 .B init
92 will wait for its termination.
93 .\"}}}
94 .\"{{{ once
95 .IP \fBonce\fP
96 The process will be executed once when the specified runlevel is
97 entered.
98 .\"}}}
99 .\"{{{ boot
100 .IP \fBboot\fP
101 The process will be executed during system boot. The \fIrunlevels\fP
102 field is ignored.
103 .\"}}}
104 .\"{{{ bootwait
105 .IP \fBbootwait\fP
106 The process will be executed during system boot, while
107 .B init
108 waits for its termination (e.g.\& /etc/rc).
109 The \fIrunlevels\fP field is ignored.
110 .\"}}}
111 .\"{{{ off
112 .IP \fBoff\fP
113 This does nothing.
114 .\"}}}
115 .\"{{{ ondemand
116 .IP \fBondemand\fP
117 A process marked with an \fBondemand\fP runlevel will be executed
118 whenever the specified \fBondemand\fP runlevel is called. However, no
119 runlevel change will occur (\fBondemand\fP runlevels are `a', `b',
120 and `c').
121 .\"}}}
122 .\"{{{ initdefault
123 .IP \fBinitdefault\fP
124 An \fBinitdefault\fP entry specifies the runlevel which should be
125 entered after system boot. If none exists,
126 .B init
127 will ask for a runlevel on the console. The \fIprocess\fP field is ignored.
128 .\"}}}
129 .\"{{{ sysinit
130 .IP \fBsysinit\fP
131 The process will be executed during system boot. It will be
132 executed before any \fBboot\fP or \fB bootwait\fP entries.
133 The \fIrunlevels\fP field is ignored.
134 .\"}}}
135 .\"{{{ powerwait
136 .IP \fBpowerwait\fP
137 The process will be executed when the power goes down. Init is usually
138 informed about this by a process talking to a UPS connected to the computer.
139 \fBInit\fP will wait for the process to finish before continuing.
140 .\"}}}
141 .\"{{{ powerfail
142 .IP \fBpowerfail\fP
143 As for \fBpowerwait\fP, except that \fBinit\fP does not wait for the process's
144 completion.
145 .\"}}}
146 .\"{{{ powerokwait
147 .IP \fBpowerokwait\fP
148 This process will be executed as soon as \fBinit\fP is informed that the
149 power has been restored.
150 .\"}}}
151 .\"{{{ powerfailnow
152 .IP \fBpowerfailnow\fP
153 This process will be executed when \fBinit\fP is told that the battery of
154 the external UPS is almost empty and the power is failing (provided that the
155 external UPS and the monitoring process are able to detect this condition).
156 .\"}}}
157 .\"{{{ ctrlaltdel
158 .IP \fBctrlaltdel\fP
159 The process will be executed when \fBinit\fP receives the SIGINT signal.
160 This means that someone on the system console has pressed the
161 \fBCTRL\-ALT\-DEL\fP key combination. Typically one wants to execute some
162 sort of \fBshutdown\fP either to get into single\-user level or to
163 reboot the machine.
164 .\"}}}
165 .\"{{{ kbrequest
166 .IP \fBkbrequest\fP
167 The process will be executed when \fBinit\fP receives a signal from the
168 keyboard handler that a special key combination was pressed on the
169 console keyboard.
170 .sp
171 The documentation for this function is not complete yet; more documentation
172 can be found in the kbd-x.xx packages (most recent was kbd-0.94 at
173 the time of this writing). Basically you want to map some keyboard
174 combination to the "KeyboardSignal" action. For example, to map Alt-Uparrow
175 for this purpose use the following in your keymaps file:
176 .RS
177 .sp
178 alt keycode 103 = KeyboardSignal
179 .sp
180 .RE
181 .\"}}}
182 .\"}}}
183 .\"{{{ Examples
184 .SH EXAMPLES
185 This is an example of a inittab which resembles the old Linux inittab:
186 .RS
187 .sp
188 .nf
189 .ne 7
190 # inittab for linux
191 id:1:initdefault:
192 rc::bootwait:/etc/rc
193 1:1:respawn:/etc/getty 9600 tty1
194 2:1:respawn:/etc/getty 9600 tty2
195 3:1:respawn:/etc/getty 9600 tty3
196 4:1:respawn:/etc/getty 9600 tty4
197 .fi
198 .sp
199 .RE
200 This inittab file executes \fB/etc/rc\fP during boot and starts gettys
201 on tty1\-tty4.
202 .PP
203 A more elaborate \fBinittab\fP with different runlevels (see the comments
204 inside):
205 .RS
206 .sp
207 .nf
208 .ne 19
209 # Level to run in
210 id:2:initdefault:
211
212 # Boot-time system configuration/initialization script.
213 si::sysinit:/etc/init.d/rcS
214
215 # What to do in single-user mode.
216 ~:S:wait:/sbin/sulogin
217
218 # /etc/init.d executes the S and K scripts upon change
219 # of runlevel.
220 #
221 # Runlevel 0 is halt.
222 # Runlevel 1 is single-user.
223 # Runlevels 2-5 are multi-user.
224 # Runlevel 6 is reboot.
225
226 l0:0:wait:/etc/init.d/rc 0
227 l1:1:wait:/etc/init.d/rc 1
228 l2:2:wait:/etc/init.d/rc 2
229 l3:3:wait:/etc/init.d/rc 3
230 l4:4:wait:/etc/init.d/rc 4
231 l5:5:wait:/etc/init.d/rc 5
232 l6:6:wait:/etc/init.d/rc 6
233
234 # What to do at the "3 finger salute".
235 ca::ctrlaltdel:/sbin/shutdown -t1 -h now
236
237 # Runlevel 2,3: getty on virtual consoles
238 # Runlevel 3: getty on terminal (ttyS0) and modem (ttyS1)
239 1:23:respawn:/sbin/getty tty1 VC linux
240 2:23:respawn:/sbin/getty tty2 VC linux
241 3:23:respawn:/sbin/getty tty3 VC linux
242 4:23:respawn:/sbin/getty tty4 VC linux
243 S0:3:respawn:/sbin/getty -L 9600 ttyS0 vt320
244 S1:3:respawn:/sbin/mgetty -x0 -D ttyS1
245
246 .fi
247 .sp
248 .RE
249 .\"}}}
250 .\"{{{ Files
251 .SH FILES
252 /etc/inittab
253 .\"}}}
254 .\"{{{ Author
255 .SH AUTHOR
256 \fBInit\fP was written by Miquel van Smoorenburg
257 (miquels@cistron.nl). This manual page was written by
258 Sebastian Lederer (lederer@francium.informatik.uni-bonn.de) and modified
259 by Michael Haardt (u31b3hs@pool.informatik.rwth-aachen.de).
260 .\"}}}
261 .\"{{{ See also
262 .SH "SEE ALSO"
263 .BR init (8),
264 .BR telinit (8)
265 .\"}}}