.\"{{{}}} .\"{{{ Title .TH INITTAB 5 "Jun 04, 1996" "" "Linux System Administrator's Manual" .\"}}} .\"{{{ Name .SH NAME inittab \- format of the inittab file used by the sysv-compatible init process .\"}}} .\"{{{ Description .SH DESCRIPTION The inittab file describes which processes are started at bootup and during normal operation (e.g.\& /etc/rc, gettys...). Init distinguishes multiple \fIrunlevels\fP, of which each can have its own set of processes that are started. Valid runlevels are \fB0\fP\-\fB6\fP and \fBA\fP, \fBB\fP and \fBC\fP for \fBondemand\fP entries. An entry in the inittab file has the following format: .RS .sp \fIid\fP:\fIrunlevels\fP:\fIaction\fP:\fIprocess\fP .sp .RE Lines beginning with `#' are ignored. .\"{{{ id .IP \fIid\fP is a unique sequence of 1-4 characters which identifies an entry in inittab (for versions of sysvinit compiled with libraries < 5.2.18 or a.out libraries the limit is 2 characters). .sp Note: For getty or other login processes, the \fIid\fP field should be the tty suffix of the corresponding tty, e.g.\& \fB1\fP for \fBtty1\fP. Otherwise, the login accounting might not work correctly. .\"}}} .\"{{{ runlevels .IP \fIrunlevels\fP describes in which runlevels the specified action should be taken. .\"}}} .\"{{{ action .IP \fIaction\fP describes which action should be taken. .\"}}} .\"{{{ process .IP \fIprocess\fP specifies the process to be executed. If the process field starts with a `+' character, init will not do utmp and wtmp accounting for that process. This is needed for gettys that insist on doing their own utmp/wtmp housekeeping. This is also a historic bug. .\"}}} .PP Valid actions are: .\"{{{ respawn .IP \fBrespawn\fP The process will be restarted whenever it terminates (e.g.\& getty). .\"}}} .\"{{{ wait .IP \fBwait\fP The process will be started once when the specified runlevel is entered and init will wait for its termination. .\"}}} .\"{{{ once .IP \fBonce\fP The process will be executed once when the specified runlevel is entered. .\"}}} .\"{{{ boot .IP \fBboot\fP The process will be executed during system boot. The \fIrunlevel\fP field is ignored. .\"}}} .\"{{{ bootwait .IP \fBbootwait\fP The process will be executed during system boot, while init waits for its termination (e.g.\& /etc/rc). The \fIrunlevel\fP field is ignored. .\"}}} .\"{{{ off .IP \fBoff\fP This does nothing. .\"}}} .\"{{{ ondemand .IP \fBondemand\fP A process marked with an \fBondemand\fP runlevel will be executed whenever the specified ondemand runlevel is called. However, no runlevel change will occur (\fBondemand\fP runlevels are 'a', 'b' and 'c'). .\"}}} .\"{{{ initdefault .IP \fBinitdefault\fP An \fBinitdefault\fP-entry specifies the runlevel which should be entered after system boot. If none exists, init will ask for a runlevel on the console. The \fIprocess\fP field is ignored. .\"}}} .\"{{{ sysinit .IP \fBsysinit\fP The process will be executed during system boot. It will be executed before any \fBboot\fP or \fB bootwait\fP entries. The \fIrunlevel\fP field is ignored. .\"}}} .\"{{{ powerwait .IP \fBpowerwait\fP The process will be executed when \fBinit\fP receives the SIGPWR signal, indicating that there is something wrong with the power. \fBInit\fP will wait for the process to finish before continuing. .\"}}} .\"{{{ powerfail .IP \fBpowerfail\fP As \fBpowerwait\fP, but init will not wait for the processes completion. .\"}}} .\"{{{ powerokwait .IP \fBpowerokwait\fP The process will be executed when \fBinit\fP receives the SIGPWR signal, provided there is a file called \fB/etc/powerstatus\fP containing the word \fBOK\fP. This means that the power has come back again. .\"}}} .\"{{{ ctrlaltdel .IP \fBctrlaltdel\fP The process will be executed when \fBinit\fP receives the SIGINT signal. This means that someone on the system console has pressed the \fBCTRL\-ALT\-DEL\fP key combination. Typically one wants to execute some sort of \fBshutdown\fP either to get into single\-user level or to reboot the machine. .\"}}} .\"{{{ kbrequest .IP \fBkbrequest\fP The process will be executed when init receives a signal from the keyboard handler that a special key combination was pressed on the console keyboard. .br The documentation for this function is not complete yet; more documentation can be found in the kbd-x.xx packages (most recent was kbd-0.91 at the time of this writing). Basically you want to map some keyboard combination to the "Spawn_Console" action. For example to map Alt-Uparrow for this purpose use the following in your keymaps file: .RS .sp alt keycode 103 = Spawn_Console .sp .RE .\"}}} .PP The \fIrunlevel\fP-field may contain multiple characters for different runlevels, e.g.\& \fB123\fP if the process should be started in runlevels 1, 2 and 3. \fBondemand\fP-entries may contain an \fBA\fP, \fBB\fP or \fBC\fP. The \fIrunlevel\fP-field of \fBsysinit\fP, \fBboot\fP and \fBbootwait\fP entries are ignored. .PP When the runlevel is changed, any running processes that are not specified for the new runlevel are killed, first with \s-2SIGTERM\s0, then with \s-2SIGKILL\s0. .\"}}} .\"{{{ Examples .SH EXAMPLES This is an example of a inittab which resembles the old Linux inittab: .RS .sp .nf .ne 7 # inittab for linux id:1:initdefault: rc::bootwait:/etc/rc 1:1:respawn:/etc/getty 9600 tty1 2:1:respawn:/etc/getty 9600 tty2 3:1:respawn:/etc/getty 9600 tty3 4:1:respawn:/etc/getty 9600 tty4 .fi .sp .RE This inittab file executes \fB/etc/rc\fP during boot and starts gettys on tty1\-tty4. .PP A more elaborate inittab with different runlevels (see the comments inside): .RS .sp .nf .ne 19 # Level to run in id:2:initdefault: # System initialization before anything else. si::sysinit:/etc/rc.d/bcheckrc # Runlevel 0,6 is halt and reboot, 1 is maintenance mode. l0:0:wait:/etc/rc.d/rc.halt l1:1:wait:/etc/rc.d/rc.single l2:2345:wait:/etc/rc.d/rc.multi l6:6:wait:/etc/rc.d/rc.reboot # What to do at the "3 finger salute". ca::ctrlaltdel:/sbin/shutdown -t5 -rf now # Runlevel 2&3: getty on console, level 3 also getty on modem port. 1:23:respawn:/sbin/getty tty1 VC linux 2:23:respawn:/sbin/getty tty2 VC linux 3:23:respawn:/sbin/getty tty3 VC linux 4:23:respawn:/sbin/getty tty4 VC linux S2:3:respawn:/sbin/uugetty ttyS2 M19200 .fi .sp .RE .\"}}} .\"{{{ Files .SH FILES /etc/inittab .\"}}} .\"{{{ Author .SH AUTHOR Init was written by Miquel van Smoorenburg (miquels@cistron.nl), the manual page was written by Sebastian Lederer (lederer@francium.informatik.uni-bonn.de) and modified by Michael Haardt (u31b3hs@pool.informatik.rwth-aachen.de). .\"}}} .\"{{{ See also .SH "SEE ALSO" init(8), telinit(8) .\"}}}