INITTAB((3))

NAME
inittab - process schedule

SYNOPSIS
/etc/inittab contains a schedule of processes that init(1) will run on transition to any given run level.

DESCRIPTION
This text file contains one line for each process schedule; the schedule lines are coded in the format of: id:level:action:process

id is a one to four character string that uniquely identifies the entry.

level is zero or more numbers and letters (0,1,2,3,4,5,6,s) that determines which level(s) action is to take place in. If level is null, the action is valid in all levels.

action can be one of sysinit , initdefault , once , wait or respawn

sysinit and initdefault are evaluated only when init(1) starts up as PID 1. initdefault names the default system state, while sysinit indicates that the inittab entry should be used only in system startup. For Example:
	#------------------------------#
	# inittab for Minix - 95/03/07 #
	#------------------------------#
1)	rlvl:2:initdefault:
2)	init::sysinit:/bin/sh -c /etc/rc.sysinit </dev/tty0 >/dev/tty0 2>&1
3)	user::sysinit:/etc/mount /dev/hd2 /usr
4)	wtmp::sysinit:/bin/touch /usr/adm/wtmp
	u000:s23:wait:/etc/mount /dev/hd2 /usr
	u001:01:wait:/bin/sh -c /etc/cron.stop
	warn:0:wait:/bin/wall You had your chance. Goodbye!!
	u004:s23:wait:/bin/sh -c /etc/cron.start
	tty0:1s23:respawn:/bin/login </dev/tty0 >/dev/tty0 2>&1
	u007:0:wait:/bin/rm /usr/adm/wtmp
	u005:01:wait:/etc/umount /dev/hd2
	u006:1s23:once:/etc/update
	rc0:0:wait:/bin/sh -c /etc/rc0 </dev/tty0 >/dev/tty0 2>&1
	#------------------------------------------------------------
line (1) above indicates the system will transfer directly to run state 2 once initialization is complete. As this line does not initiate an action, the 'process' field is ignored, and may be left empty. Lines (2), (3), and (4) are each executed only once, in sequence, during initialization. Since they are "sysinit" actions, the 'level' field is ignored, and may be left empty. once , wait , and respawn apply to the transition to and maintenance of a specific system state. once indicates that the inittab line will only be executed once, during the transition to one of the states listed in the 'level' field. Init will continue with the processing of the next inittab record while the 'once' process is executing. wait indicates that the inittab line will only be executed once, during the transition to one of the states listed in the 'level' field. Unlike 'once' however, 'wait' will cause init to wait for completion of the specified process before continueing with the next inittab record. respawn indicates that the inittab line will be executed on transition into the state, and re-executed each time that the named process completes. Init will not wait for completion of the process. Example:
	#------------------------------#
	# inittab for Minix - 95/03/07 #
	#------------------------------#
	rlvl:2:initdefault:
	init::sysinit:/bin/sh -c /etc/rc.sysinit </dev/tty0 >/dev/tty0 2>&1
	user::sysinit:/etc/mount /dev/hd2 /usr
	wtmp::sysinit:/bin/touch /usr/adm/wtmp
1)	u000:s23:wait:/etc/mount /dev/hd2 /usr
2)	u001:01:wait:/bin/sh -c /etc/cron.stop
3)	warn:0:wait:/bin/wall You had your chance. Goodbye!!
4)	u004:s23:wait:/bin/sh -c /etc/cron.start
5)	tty0:1s23:respawn:/bin/login </dev/tty0 >/dev/tty0 2>&1
6)	u007:0:wait:/bin/rm /usr/adm/wtmp
7)	u005:01:wait:/etc/umount /dev/hd2
8)	u006:1s23:once:/etc/update
9)	rc0:0:wait:/bin/sh -c /etc/rc0 </dev/tty0 >/dev/tty0 2>&1
	#------------------------------------------------------------
Lines (1), (4), (5), and (8) will be executed on transition to run level 2. Line (1) will cause init to wait until the process ("/etc/mount ...") is complete before continueing with the next line. Line (4) ("/bin/sh ..." will also wait before continueing. However, line (5) causes init to start the process ("/bin/login ..."), and continue before the process completes. Further, the process named in line (5) will be restarted each time it terminates, so long as we remain in this state. Finally, line (8) is executed just once, ("/etc/update"), and init does not wait for its termination.
Equally, lines (2), (3), (6), (7), and (9) describe the transition to run level 0. Of interest to note is that transition to state 0 causes init to force the termination of the process named in line (5) if it is still executing.

SEE ALSO
init(1), proc1(1), telinit(1), and utmp(3)

CAVEATS

BUGS