1
'\" -*- coding: UTF-8 -*-
2
.\" Copyright (C) 1998-2001 Miquel van Smoorenburg.
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.
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.
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
20
.TH INITTAB 5 "Dec 4, 2001" "" "Linux System Administrator's Manual"
24
inittab \- format of the inittab file used by the sysv-compatible init
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...).
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:
38
\fIid\fP:\fIrunlevels\fP:\fIaction\fP:\fIprocess\fP
41
Lines beginning with `#' are ignored.
44
is a unique sequence of 1-4 characters which identifies an entry in
46
(for versions of sysvinit compiled with the \fIold\fP libc5 (< 5.2.18) or
47
a.out libraries the limit is 2 characters).
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.
56
lists the runlevels for which the specified action should be taken.
60
describes which action should be taken.
64
specifies the process to be executed. If the process field starts with
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
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.
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.
83
Valid actions for the \fIaction\fP field are:
86
The process will be restarted whenever it terminates (e.g.\& getty).
90
The process will be started once when the specified runlevel is entered and
92
will wait for its termination.
96
The process will be executed once when the specified runlevel is
101
The process will be executed during system boot. The \fIrunlevels\fP
106
The process will be executed during system boot, while
108
waits for its termination (e.g.\& /etc/rc).
109
The \fIrunlevels\fP field is ignored.
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',
123
.IP \fBinitdefault\fP
124
An \fBinitdefault\fP entry specifies the runlevel which should be
125
entered after system boot. If none exists,
127
will ask for a runlevel on the console. The \fIprocess\fP field is ignored.
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.
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.
143
As for \fBpowerwait\fP, except that \fBinit\fP does not wait for the process's
147
.IP \fBpowerokwait\fP
148
This process will be executed as soon as \fBinit\fP is informed that the
149
power has been restored.
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).
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
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
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:
178
alt keycode 103 = KeyboardSignal
185
This is an example of a inittab which resembles the old Linux inittab:
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
200
This inittab file executes \fB/etc/rc\fP during boot and starts gettys
203
A more elaborate \fBinittab\fP with different runlevels (see the comments
212
# Boot-time system configuration/initialization script.
213
si::sysinit:/etc/init.d/rcS
215
# What to do in single-user mode.
216
~:S:wait:/sbin/sulogin
218
# /etc/init.d executes the S and K scripts upon change
221
# Runlevel 0 is halt.
222
# Runlevel 1 is single-user.
223
# Runlevels 2-5 are multi-user.
224
# Runlevel 6 is reboot.
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
234
# What to do at the "3 finger salute".
235
ca::ctrlaltdel:/sbin/shutdown -t1 -h now
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
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).