| Rev | Author | # | Line |
|---|---|---|---|
| 3 | perry | 1 | !!!INITTAB |
| 5 | JohnMcPherson | 2 | |
| 3 | perry | 3 | ---- |
| 4 | !!NAME | ||
| 5 | |||
| 6 | |||
| 7 | inittab - format of the inittab file used by the sysv-compatible init process | ||
| 5 | JohnMcPherson | 8 | |
| 3 | perry | 9 | !!DESCRIPTION |
| 10 | |||
| 11 | |||
| 12 | The __inittab__ file describes which processes are | ||
| 13 | started at bootup and during normal operation (e.g. | ||
| 5 | JohnMcPherson | 14 | /etc/init.d/boot, /etc/init.d/rc, gettys...). init(8) |
| 3 | perry | 15 | distinguishes multiple ''runlevels'', each of which can |
| 16 | have its own set of processes that are started. Valid | ||
| 17 | runlevels are __0__-__6__ plus __A__, __B__, and | ||
| 18 | __C__ for __ondemand__ entries. An entry in the | ||
| 19 | __inittab__ file has the following format: | ||
| 20 | |||
| 21 | |||
| 22 | ''id'':''runlevels'':''action'':''process'' | ||
| 23 | |||
| 24 | |||
| 25 | Lines beginning with `#' are ignored. | ||
| 26 | |||
| 27 | |||
| 28 | ''id'' | ||
| 29 | |||
| 30 | |||
| 31 | is a unique sequence of 1-4 characters which identifies an | ||
| 32 | entry in __inittab__ (for versions of sysvinit compiled | ||
| 33 | with the ''old'' libc5 ( | ||
| 34 | '' | ||
| 35 | |||
| 36 | |||
| 37 | Note: traditionally, for getty and other login processes, | ||
| 38 | the value of the ''id'' field is kept the same as the | ||
| 39 | suffix of the corresponding tty, e.g. __1__ for | ||
| 40 | __tty1__. Some ancient login accounting programs might | ||
| 41 | expect this, though I can't think of any. | ||
| 42 | |||
| 43 | |||
| 44 | ''runlevels'' | ||
| 45 | |||
| 46 | |||
| 47 | lists the runlevels for which the specified action should be | ||
| 48 | taken. | ||
| 49 | |||
| 50 | |||
| 51 | ''action'' | ||
| 52 | |||
| 53 | |||
| 54 | describes which action should be taken. | ||
| 55 | |||
| 56 | |||
| 57 | ''process'' | ||
| 58 | |||
| 59 | |||
| 60 | specifies the process to be executed. If the process field | ||
| 61 | starts with a `+' character, __init__ will not do utmp | ||
| 62 | and wtmp accounting for that process. This is needed for | ||
| 63 | gettys that insist on doing their own utmp/wtmp | ||
| 64 | housekeeping. This is also a historic bug. | ||
| 65 | |||
| 66 | |||
| 67 | The ''runlevels'' field may contain multiple characters | ||
| 68 | for different runlevels. For example, __123__ specifies | ||
| 69 | that the process should be started in runlevels 1, 2, and 3. | ||
| 70 | The ''runlevels'' for __ondemand__ entries may contain | ||
| 71 | an __A__, __B__, or __C__. The ''runlevels'' | ||
| 72 | field of __sysinit__, __boot__, and __bootwait__ | ||
| 73 | entries are ignored. | ||
| 74 | |||
| 75 | |||
| 76 | When the system runlevel is changed, any running processes | ||
| 77 | that are not specified for the new runlevel are killed, | ||
| 78 | first with SIGTERM , then with | ||
| 79 | SIGKILL . | ||
| 80 | |||
| 81 | |||
| 82 | Valid actions for the ''action'' field are: | ||
| 83 | |||
| 84 | |||
| 85 | __respawn__ | ||
| 86 | |||
| 87 | |||
| 88 | The process will be restarted whenever it terminates (e.g. | ||
| 89 | getty). | ||
| 90 | |||
| 91 | |||
| 92 | __wait__ | ||
| 93 | |||
| 94 | |||
| 95 | The process will be started once when the specified runlevel | ||
| 96 | is entered and __init__ will wait for its | ||
| 97 | termination. | ||
| 98 | |||
| 99 | |||
| 100 | __once__ | ||
| 101 | |||
| 102 | |||
| 103 | The process will be executed once when the specified | ||
| 104 | runlevel is entered. | ||
| 105 | |||
| 106 | |||
| 107 | __boot__ | ||
| 108 | |||
| 109 | |||
| 110 | The process will be executed during system boot. The | ||
| 111 | ''runlevels'' field is ignored. | ||
| 112 | |||
| 113 | |||
| 114 | __bootwait__ | ||
| 115 | |||
| 116 | |||
| 117 | The process will be executed during system boot, while | ||
| 118 | __init__ waits for its termination (e.g. /etc/rc). The | ||
| 119 | ''runlevels'' field is ignored. | ||
| 120 | |||
| 121 | |||
| 122 | __off__ | ||
| 123 | |||
| 124 | |||
| 125 | This does nothing. | ||
| 126 | |||
| 127 | |||
| 128 | __ondemand__ | ||
| 129 | |||
| 130 | |||
| 131 | A process marked with an __ondemand__ runlevel will be | ||
| 132 | executed whenever the specified __ondemand__ runlevel is | ||
| 133 | called. However, no runlevel change will occur | ||
| 134 | (__ondemand__ runlevels are `a', `b', and | ||
| 135 | `c'). | ||
| 136 | |||
| 137 | |||
| 138 | __initdefault__ | ||
| 139 | |||
| 140 | |||
| 141 | An __initdefault__ entry specifies the runlevel which | ||
| 142 | should be entered after system boot. If none exists, | ||
| 143 | __init__ will ask for a runlevel on the console. The | ||
| 144 | ''process'' field is ignored. | ||
| 145 | |||
| 146 | |||
| 147 | __sysinit__ | ||
| 148 | |||
| 149 | |||
| 150 | The process will be executed during system boot. It will be | ||
| 151 | executed before any __boot__ or __bootwait__ entries. | ||
| 152 | The ''runlevels'' field is ignored. | ||
| 153 | |||
| 154 | |||
| 155 | __powerwait__ | ||
| 156 | |||
| 157 | |||
| 158 | The process will be executed when the power goes down. Init | ||
| 159 | is usually informed about this by a process talking to a UPS | ||
| 160 | connected to the computer. __Init__ will wait for the | ||
| 161 | process to finish before continuing. | ||
| 162 | |||
| 163 | |||
| 164 | __powerfail__ | ||
| 165 | |||
| 166 | |||
| 167 | As for __powerwait__, except that __init__ does not | ||
| 168 | wait for the process's completion. | ||
| 169 | |||
| 170 | |||
| 171 | __powerokwait__ | ||
| 172 | |||
| 173 | |||
| 174 | This process will be executed as soon as __init__ is | ||
| 175 | informormed that the power has been restored. | ||
| 176 | |||
| 177 | |||
| 178 | __powerfailnow__ | ||
| 179 | |||
| 180 | |||
| 181 | This process will be executed when __init__ is told that | ||
| 182 | the battery of the external UPS is almost empty and the | ||
| 183 | power is failing (provided that the external UPS and the | ||
| 184 | monitoring process are able to detect this | ||
| 185 | condition). | ||
| 186 | |||
| 187 | |||
| 188 | __ctrlaltdel__ | ||
| 189 | |||
| 190 | |||
| 191 | The process will be executed when __init__ receives the | ||
| 192 | SIGINT signal. This means that someone on the system console | ||
| 193 | has pressed the __CTRL-ALT-DEL__ key combination. | ||
| 194 | Typically one wants to execute some sort of __shutdown__ | ||
| 195 | either to get into single-user level or to reboot the | ||
| 196 | machine. | ||
| 197 | |||
| 198 | |||
| 199 | __kbrequest__ | ||
| 200 | |||
| 201 | |||
| 202 | The process will be executed when __init__ receives a | ||
| 203 | signal from the keyboard handler that a special key | ||
| 204 | combination was pressed on the console | ||
| 205 | keyboard. | ||
| 206 | |||
| 207 | |||
| 208 | The documentation for this function is not complete yet; | ||
| 209 | more documentation can be found in the kbd-x.xx packages | ||
| 210 | (most recent was kbd-0.94 at the time of this writing). | ||
| 211 | Basically you want to map some keyboard combination to the | ||
| 212 | |||
| 213 | |||
| 214 | alt keycode 103 = !KeyboardSignal | ||
| 215 | !!EXAMPLES | ||
| 216 | |||
| 217 | |||
| 218 | This is an example of a inittab which resembles the old | ||
| 219 | Linux inittab: | ||
| 220 | |||
| 221 | |||
| 222 | # inittab for linux | ||
| 223 | id:1:initdefault: | ||
| 224 | rc::bootwait:/etc/rc | ||
| 225 | 1:1:respawn:/etc/getty 9600 tty1 | ||
| 226 | 2:1:respawn:/etc/getty 9600 tty2 | ||
| 227 | 3:1:respawn:/etc/getty 9600 tty3 | ||
| 228 | 4:1:respawn:/etc/getty 9600 tty4 | ||
| 229 | |||
| 230 | |||
| 231 | This inittab file executes __/etc/rc__ during boot and | ||
| 232 | starts gettys on tty1-tty4. | ||
| 233 | |||
| 234 | |||
| 235 | A more elaborate __inittab__ with different runlevels | ||
| 236 | (see the comments inside): | ||
| 237 | |||
| 238 | |||
| 239 | # Level to run in | ||
| 240 | id:2:initdefault: | ||
| 241 | # Boot-time system configuration/initialization script. | ||
| 242 | si::sysinit:/etc/init.d/rcS | ||
| 243 | # What to do in single-user mode. | ||
| 244 | ~:S:wait:/sbin/sulogin | ||
| 245 | # /etc/init.d executes the S and K scripts upon change | ||
| 246 | # of runlevel. | ||
| 247 | # | ||
| 248 | # Runlevel 0 is halt. | ||
| 249 | # Runlevel 1 is single-user. | ||
| 250 | # Runlevels 2-5 are multi-user. | ||
| 251 | # Runlevel 6 is reboot. | ||
| 252 | l0:0:wait:/etc/init.d/rc 0 | ||
| 253 | l1:1:wait:/etc/init.d/rc 1 | ||
| 254 | l2:2:wait:/etc/init.d/rc 2 | ||
| 255 | l3:3:wait:/etc/init.d/rc 3 | ||
| 256 | l4:4:wait:/etc/init.d/rc 4 | ||
| 257 | l5:5:wait:/etc/init.d/rc 5 | ||
| 258 | l6:6:wait:/etc/init.d/rc 6 | ||
| 259 | # What to do at the | ||
| 260 | !!FILES | ||
| 261 | |||
| 262 | |||
| 263 | /etc/inittab | ||
| 264 | !!AUTHOR | ||
| 265 | |||
| 266 | |||
| 267 | __Init__ was written by Miquel van Smoorenburg | ||
| 268 | (miquels@cistron.nl). This manual page was written by | ||
| 269 | Sebastian Lederer (lederer@francium.informatik.uni-bonn.de) | ||
| 270 | and modified by Michael Haardt | ||
| 271 | (u31b3hs@pool.informatik.rwth-aachen.de). | ||
| 272 | !!SEE ALSO | ||
| 273 | |||
| 274 | |||
| 275 | init(8), telinit(8) | ||
| 276 | ---- |
lib/blame.php:177: Warning: Invalid argument supplied for foreach()