1INITTAB(5) Linux System Administrator's Manual INITTAB(5)
2
3
4
6 inittab - format of the inittab file used by the sysv-compatible init
7 process
8
10 The inittab file describes which processes are started at bootup and
11 during normal operation (e.g. /etc/init.d/boot, /etc/init.d/rc, get‐
12 tys...). Init(8) distinguishes multiple runlevels, each of which can
13 have its own set of processes that are started. Valid runlevels are
14 0-6 plus A, B, and C for ondemand entries. An entry in the inittab
15 file has the following format:
16
17 id:runlevels:action:process
18
19 Lines beginning with `#' are ignored.
20
21 id is a unique sequence of 1-4 characters which identifies an entry
22 in inittab (for versions of sysvinit compiled with the old libc5
23 (< 5.2.18) or a.out libraries the limit is 2 characters).
24
25 Note: traditionally, for getty and other login processes, the
26 value of the id field is kept the same as the suffix of the cor‐
27 responding tty, e.g. 1 for tty1. Some ancient login accounting
28 programs might expect this, though I can't think of any.
29
30 runlevels
31 lists the runlevels for which the specified action should be
32 taken.
33
34 action describes which action should be taken.
35
36 process
37 specifies the process to be executed. If the process field
38 starts with a `+' character, init will not do utmp and wtmp
39 accounting for that process. This is needed for gettys that
40 insist on doing their own utmp/wtmp housekeeping. This is also
41 a historic bug.
42
43 The runlevels field may contain multiple characters for different run‐
44 levels. For example, 123 specifies that the process should be started
45 in runlevels 1, 2, and 3. The runlevels for ondemand entries may con‐
46 tain an A, B, or C. The runlevels field of sysinit, boot, and bootwait
47 entries are ignored.
48
49 When the system runlevel is changed, any running processes that are not
50 specified for the new runlevel are killed, first with SIGTERM, then
51 with SIGKILL.
52
53 Valid actions for the action field are:
54
55 respawn
56 The process will be restarted whenever it terminates (e.g.
57 getty).
58
59 wait The process will be started once when the specified runlevel is
60 entered and init will wait for its termination.
61
62 once The process will be executed once when the specified runlevel is
63 entered.
64
65 boot The process will be executed during system boot. The runlevels
66 field is ignored.
67
68 bootwait
69 The process will be executed during system boot, while init
70 waits for its termination (e.g. /etc/rc). The runlevels field
71 is ignored.
72
73 off This does nothing.
74
75 ondemand
76 A process marked with an ondemand runlevel will be executed
77 whenever the specified ondemand runlevel is called. However, no
78 runlevel change will occur (ondemand runlevels are `a', `b', and
79 `c').
80
81 initdefault
82 An initdefault entry specifies the runlevel which should be
83 entered after system boot. If none exists, init will ask for a
84 runlevel on the console. The process field is ignored.
85
86 sysinit
87 The process will be executed during system boot. It will be exe‐
88 cuted before any boot or bootwait entries. The runlevels field
89 is ignored.
90
91 powerwait
92 The process will be executed when the power goes down. Init is
93 usually informed about this by a process talking to a UPS con‐
94 nected to the computer. Init will wait for the process to fin‐
95 ish before continuing.
96
97 powerfail
98 As for powerwait, except that init does not wait for the
99 process's completion.
100
101 powerokwait
102 This process will be executed as soon as init is informormed
103 that the power has been restored.
104
105 powerfailnow
106 This process will be executed when init is told that the battery
107 of the external UPS is almost empty and the power is failing
108 (provided that the external UPS and the monitoring process are
109 able to detect this condition).
110
111 ctrlaltdel
112 The process will be executed when init receives the SIGINT sig‐
113 nal. This means that someone on the system console has pressed
114 the CTRL-ALT-DEL key combination. Typically one wants to execute
115 some sort of shutdown either to get into single-user level or to
116 reboot the machine.
117
118 kbrequest
119 The process will be executed when init receives a signal from
120 the keyboard handler that a special key combination was pressed
121 on the console keyboard.
122
123 The documentation for this function is not complete yet; more
124 documentation can be found in the kbd-x.xx packages (most recent
125 was kbd-0.94 at the time of this writing). Basically you want to
126 map some keyboard combination to the "KeyboardSignal" action.
127 For example, to map Alt-Uparrow for this purpose use the follow‐
128 ing in your keymaps file:
129
130 alt keycode 103 = KeyboardSignal
131
132
134 This is an example of a inittab which resembles the old Linux inittab:
135
136 # inittab for linux
137 id:1:initdefault:
138 rc::bootwait:/etc/rc
139 1:1:respawn:/etc/getty 9600 tty1
140 2:1:respawn:/etc/getty 9600 tty2
141 3:1:respawn:/etc/getty 9600 tty3
142 4:1:respawn:/etc/getty 9600 tty4
143
144 This inittab file executes /etc/rc during boot and starts gettys on
145 tty1-tty4.
146
147 A more elaborate inittab with different runlevels (see the comments
148 inside):
149
150 # Level to run in
151 id:2:initdefault:
152
153 # Boot-time system configuration/initialization script.
154 si::sysinit:/etc/rc.sysinit
155
156 # What to do in single-user mode.
157 ~:S:wait:/sbin/sulogin
158
159 # /etc/init.d executes the S and K scripts upon change
160 # of runlevel.
161 #
162 # Runlevel 0 is halt.
163 # Runlevel 1 is single-user.
164 # Runlevels 2-5 are multi-user.
165 # Runlevel 6 is reboot.
166
167 l0:0:wait:/etc/rc 0
168 l1:1:wait:/etc/rc 1
169 l2:2:wait:/etc/rc 2
170 l3:3:wait:/etc/rc 3
171 l4:4:wait:/etc/rc 4
172 l5:5:wait:/etc/rc 5
173 l6:6:wait:/etc/rc 6
174
175 # What to do at the "3 finger salute".
176 ca::ctrlaltdel:/sbin/shutdown -t3 -r now
177
178 # Runlevel 2,3: getty on virtual consoles
179 # Runlevel 3: mgetty on terminal (ttyS0) and modem (ttyS1)
180 1:23:respawn:/sbin/mingetty tty1
181 2:23:respawn:/sbin/mingetty tty2
182 3:23:respawn:/sbin/mingetty tty3
183 4:23:respawn:/sbin/mingetty tty4
184 S0:3:respawn:/sbin/agetty ttyS0 9600 vt100-nav
185 S1:3:respawn:/sbin/mgetty -x0 -D ttyS1
186
187
188
190 /etc/inittab
191
193 Init was written by Miquel van Smoorenburg (miquels@cistron.nl). This
194 manual page was written by Sebastian Lederer (lederer@francium.infor‐
195 matik.uni-bonn.de) and modified by Michael Haardt (u31b3hs@pool.infor‐
196 matik.rwth-aachen.de).
197
199 init(8), telinit(8)
200
201
202
203 Dec 4, 2001 INITTAB(5)