


INIT(8)		Linux Programmer's Manual		INIT(8)


NNAAMMEE
       init, telinit - process control initialization

SSYYNNOOPPSSIISS
       //eettcc//iinniitt [ --tt sseecc ] [ 00112233445566SSssQQqq ]
       //bbiinn//tteelliinniitt [ --tt sseecc ] [ 00112233445566ssSSQQqqaabbcc ]

DDEESSCCRRIIPPTTIIOONN
   IInniitt
       IInniitt  is the father of all processes.  Its primary role is
       to create processes from	a  script  stored  in	the  file
       //eettcc//iinniittttaabb  (see  _i_n_i_t_t_a_b(5)).	This	file  usually has
       entries which cause iinniitt to spawn ggeettttyys on each line that
       users  can  log in.  It also controls autonomous processes
       required by any particular system.

       A _r_u_n _l_e_v_e_l is a	software  configuration  of  the  system
       which  allows only a selected group of processes to exist.
       The processes spawned by iinniitt for each of these _r_u_n _l_e_v_e_l_s
       are  defined in the //eettcc//iinniittttaabb file.  IInniitt can be in one
       of eight _r_u_n _l_e_v_e_ls, 00--66 and SS or ss.   The  _r_u_n	_l_e_v_e_l  is
       changed	by  having  a  privileged  user run //bbiinn//tteelliinniitt,
       which sends appropriate signals to iinniitt, telling it  which
       run level to change to.

       After iinniitt is invoked as the last step of the kernel boot-
       ing, it looks for the file //eettcc//iinniittttaabb to see if there is
       an  entry of the type iinniittddeeffaauulltt (see _i_n_i_t_t_a_b(5)).  iinniitt--
       ddeeffaauulltt determines the initial run level	of  the  system.
       If there is no such entry or no //eettcc//iinniittttaabb at all, a _r_u_n
       _l_e_v_e_l has to be entered at the system console.

       _R_u_n _l_e_v_e_l SS or ss bring the system to single user mode  and
       do  not	require	an  //eettcc//iinniittttttaabb  file.  In single user
       mode, //bbiinn//ssuu is invoked on //ddeevv//ccoonnssoollee.

       When entering single user mode,	iinniitt  saves  the  console
       _i_o_c_t_l(2)	state	to //eettcc//iiooccttll..ssaavvee and resets the console
       to these states when exiting to multi user mode.	If  this
       file does not exist then default settings are used.

       When  entering a multi user mode the first time, iinniitt per-
       forms the bboooott and bboooottwwaaiitt entries to allow file  systems
       to  be  mounted before users can log in.	Then all entries
       matching the _r_u_n _l_e_v_e_l are processed.

       Each time a child terminates, iinniitt records  the	fact  and
       the reason it died in //eettcc//uuttmmpp and //uussrr//aaddmm//wwttmmpp if these
       files exist.

       After it has spawned all of the processes specified,  iinniitt
       waits for one of its descendant processes to die, a power-
       fail signal, or until it is signaled  by	//bbiinn//tteelliinniitt  to
       change  the  system's  _r_u_n  _l_e_v_e_l.   When one of the above



			   May 1, 1993				1





INIT(8)		Linux Programmer's Manual		INIT(8)


       three conditions occurs, it re-examines the  //eettcc//iinniittttaabb.
       file.   New entries can be added to this file at any time.
       However, iinniitt still waits for one of the above three  con-
       ditions	to  occur.   To  provide  for	an  instantaneous
       response, the QQ or qq command  can  wake	up  iinniitt  to  re-
       examine the //eettcc//iinniittttaabb file.

       If  iinniitt	is not in single user mode and receives a power-
       fail signal, special powerfail entries are invoked.

       When iinniitt is requested to change the _r_u_n _l_e_v_e_l,	it  sends
       the warning signal SSIIGGTTEERRMM to all processes that are unde-
       fined in the new _r_u_n _l_e_v_e_l.   It	then  waits  20  seconds
       before  forcibly	terminating these processes via the kill
       signal SSIIGGKKIILLLL.	Note that iinniitt	assumes	that  all  these
       processes  (and their descendants) remain in the same pro-
       cess group which iinniitt originally created for them.  If any
       process	changes its process group affiliation it will not
       receive these signals.  Such processes need to  be  termi-
       nated separately.

   tteelliinniitt
       //bbiinn//tteelliinniitt  is	linked	to  //eettcc//iinniitt.	It takes a one-
       character argument and signals iinniitt to perform the  appro-
       priate  action.	The  following arguments serve as direc-
       tives to //bbiinn//tteelliinniitt:

       00,11,22,33,44,55 or 66
	      tell //eettcc//iinniitt  to  switch  to  the  specified  run
	      level.

       aa,bb,cc  tell  //eettcc//iinniitt  to process only those //eettcc//iinniittttaabb
	      file entries having _r_u_n _l_e_v_e_l aa,bb or cc.

       QQ or qq tells  //eettcc//iinniitt	to  re-examine	the  //eettcc//iinniittttaabb
	      file.

       SS or ss tells //eettcc//iinniitt to switch to single user mode.

       //bbiinn//tteelliinniitt  can  also	tell init how much time it should
       wait between sending processes the TERM and the KILL  sig-
       nal;  default this is 20 seconds, but it can be changed by
       the --tt sseecc option.

       //bbiinn//tteelliinniitt can be invoked only by users with appropriate
       privileges.

FFIILLEESS
       /etc/inittab
       /dev/console
       /etc/utmp
       /usr/adm/wtmp





			   May 1, 1993				2





INIT(8)		Linux Programmer's Manual		INIT(8)


CCOONNFFOORRMMIINNGG TTOO
       IInniitt  is	not really System V compatible.  It is more mod-
       eled after the HHPP--UUXX  iinniitt.   This  might  change  in  the
       future if people feel that is really needed.

WWAARRNNIINNGGSS
       IInniitt  assumes  that processes and descendants of processes
       remain in the same process group which was originally cre-
       ated  for them.	If the processes change their group, iinniitt
       can't kill them and you may  end	up  with  two	processes
       reading from one terminal line.

DDIIAAGGNNOOSSTTIICCSS
       If  //eettcc//iinniitt  finds that it is continuously respawning an
       entry more than 10 times in 2 minutes, it will assume that
       there is an error in the command string, generate an error
       message on the system console, and refuse to respawn  this
       entry  until either 5 minutes has elapsed or it receives a
       signal.	This prevents it from eating up system	resources
       when   someone	makes	a   typographical  error  in  the
       //eettcc//iinniittttaabb file or the program for the entry is removed.

RREESSTTRRIICCTTIIOONNSS
       If  iinniitt	or  tteelliinniitt is used to go into single user mode,
       the terminal from which	this  command  was  given  should
       become the new logical system console.  This is not imple-
       mented.	Also, IInniitt should save the modes  of  the  system
       console every time single user mode is entered in the file
       //eettcc//iiooccttll..ssaavvee, and restore them when single user mode is
       left.  This is also not implemented.

AAUUTTHHOORR
       Miquel  van  Smoorenburg	(miquels@drinkel.nl.mugnet.org),
       initial	manual     page     by     Michael	Haardt
       (u31b3hs@pool.informatik.rwth-aachen.de).

SSEEEE AALLSSOO
       getty(1),  login(1),  sh(1),  who(1), kill(2), inittab(5),
       utmp(5).


















			   May 1, 1993				3


