INITTAB(5)

NAME
inittab - format of the inittab file used by the SysV-compatible init process

DESCRIPTION
The inittab file describes which processes are started at bootup and during normal operation ( e.g. /etc/rc, gettys...). Init distinguishes multiple runlevels , of which each can have its own set of processes that are started. Valid runlevels are 0-6 and A , B , C for ondemand entries. An entry in the inittab file has the following format:

id:runlevels:action:process

Lines beginning with '#' are ignored.

id  is a unique two-character-sequence which identifies an entry in inittab. NOTE: For gettys or other login processes, the id field should be the tty suffix of the corresponding tty, eg 1 for tty1. Otherwise, the login accounting will not work correctly. This is a bug in login and will be fixed.

runlevels
    describes in which runlevels the specified action should be taken

action
    describes which action should be taken.

process
    specifies the process to be executed.

Valid actions are:

respawn
    The process will be restarted whenever it terminates ( e.g. getty )

wait
    The process will be started once when the specified runlevel is entered and init will wait for its termination.

once
    The process will be executed once when the specified runlevel is entered.

boot
    The process will be executed during system boot. The runlevel field is ignored.

bootwait
    The process will be executed during system boot, while init waits for its termination (e.g. /etc/rc). The runlevel field is ignored.

off This does nothing.

ondemand
    A process marked with an ondemand runlevel will be executed whenever the specified ondemand runlevel is called. However, no runlevel change will occur.

initdefault
    An initdefault -entry specifies the runlevel which should be entered after system boot. If none exists, init will ask for a runlevel on the console.

sysinit
    The process will be executed during system boot. It will be executed before any boot or bootwait entries.

The runlevel-field may contain multiple characters for different runlevels, e.g 123 if the process should be started in runlevels 1,2 and 3. ondemand- entries may contain an A,B or C. The runlevel-field of sysinit,boot and bootwait entries are ignored.

When the runlevel is changed, any running processes that are not specified for the new runlevel are killed, first with SIGTERM, then with SIGKILL.

EXAMPLE
This is an example of a inittab which resembles the old Linux inittab:

# 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

This inittab file executes /etc/rc during boot and starts gettys on tty1-tty4.

A more elaborate inittab with different runlevels (see the comments inside):

# Level to run in
id:4:initdefault:
ud::boot:/etc/update
rc::bootwait:/etc/rc
cr::boot:/etc/crond
#
# level 1: getty on tty1
# level 2: getty on tty1-4
# level 3: tty1-4, dialin via modem(ttys2)
# level 4: tty1-4, ttyb
#
mr:126:once:/usr/bin/nodialin
mi:345:once:/usr/bin/dialin
1:1234:respawn:/etc/getty 9600 tty1
2:234:respawn:/etc/getty 9600 tty2
3:234:respawn:/etc/getty 9600 tty3
4:234:respawn:/etc/getty 9600 tty4
s2:3:respawn:/etc/mgetty ttys2 19200
b:4:respawn:/etc/getty 19200L ttyb

SEE ALSO
init(8),telinit(8)

FILES
/etc/inittab

MANPAGE
lederer@francium.informatik.uni-bonn.de (Sebastian Lederer)