|Newer page:||version 3||Last edited on Friday, August 13, 2004 7:44:47 pm||by JohnMcPherson|
|Older page:||version 1||Last edited on Tuesday, June 4, 2002 12:31:13 am||by perry||Revert|
@@ -1,50 +1,30 @@
init, telinit - process control initialization
-__/sbin/init__ [[ __-a__ ] [[ __-s__ ] [[ __-b__ ]
[[ __-z xxx__ ] [[ __0123456Ss__ ] __
/sbin/telinit__ [[ __-t sec__ ] [[
+__/sbin/init__ [[ __-a__ ] [[ __-s__ ] [[ __-b__ ] [[ __-z xxx__ ] [[ __0123456Ss__ ]
__Init__ is the parent of all processes. Its primary role
is to create processes from a script stored in the file
__/etc/inittab__ (see inittab(5)). This file
usually has entries which cause __init__ to spawn
__getty__s on each line that users can log in. It also
controls autonomous processes required by any particular
A ''runlevel'' is a software configuration of the system
which allows only a selected group of processes to exist.
The processes spawned by __init__ for each of these
@@ -70,25 +50,23 @@
This is because
''s'' are in fact the same. Internally they are aliases
for the same runlevel.
After __init__ is invoked as the last step of the kernel
boot sequence, it looks for the file __/etc/inittab__ to
see if there is an entry of the type __initdefault__ (see
inittab(5)). The __initdefault__ entry determines
the initial runlevel of the system. If there is no such
entry (or no __/etc/inittab__ at all), a runlevel must be
entered at the system console.
Runlevel __S__ or __s__ bring the system to single
user mode and do not require an __/etc/inittab__ file. In
single user mode, __/sbin/sulogin__ is invoked on
When entering single user mode, __init__ reads the
console's ioctl(2) states from
__/etc/ioctl.save__. If this file does not exist,
@@ -96,28 +74,25 @@
with __CLOCAL__ settings. When __init__ leaves single
user mode, it stores the console's ''ioctl'' settings in
this file so it can re-use them for the next single-user
When entering a multi-user mode for the first time,
__init__ performs the __boot__ and __bootwait__
entries to allow file systems to be mounted before users can
log in. Then all entries matching the runlevel are
When starting a new process, __init__ first checks
whether the file ''/etc/initscript'' exists. If it does,
it uses this script to start the process.
Each time a child terminates, __init__ records the fact
and the reason it died in __/var/run/utmp__ and
__/var/log/wtmp__, provided that these files
After it has spawned all of the processes specified,
__init__ waits for one of its descendant processes to
die, a powerfail signal, or until it is signaled by
@@ -128,48 +103,38 @@
of the above three conditions to occur. To provide for an
instantaneous response, the __telinit Q__ or __q__
command can wake up __init__ to re-examine the
If __init__ is not in single user mode and receives a
powerfail signal (SIGPWR), it reads the file
__/etc/powerstatus__. It then starts a command based on
the contents of this file:
Power is failing, UPS is providing the power. Execute the
__powerwait__ and __powerfail__ entries.
The power has been restored, execute the __powerokwait__
The power is failing and the UPS has a low battery. Execute
the __powerfailnow__ entries.
If /etc/powerstatus doesn't exist or contains anything else
then the letters __F__, __O__ or __L__, init will
behave as if it has read the letter __F__.
Usage of __SIGPWR__ and __/etc/powerstatus__ is
discouraged. Someone wanting to interact with __init__
should use the __/dev/initctl__ control channel - see the
source code of the __sysvinit__ package for more
documentation about this.
When __init__ is requested to change the runlevel, it
sends the warning signal __SIGTERM__ to
all processes that are undefined in the new runlevel. It
@@ -180,27 +145,23 @@
__init__ originally created for them. If any process
changes its process group affiliation it will not receive
these signals. Such processes need to be terminated
__/sbin/telinit__ is linked to __/sbin/init__. It
takes a one-character argument and signals __init__ to
perform the appropriate action. The following arguments
serve as directives to __telinit__:
tell __init__ to switch to the specified run
tell __init__ to process only those __/etc/inittab__
file entries having runlevel __a__,__b__ or
@@ -281,10 +242,11 @@
The system console. This is really inherited from the
kernel; however if it is not set __init__ will set it to
__/dev/console__ by default.
It is possible to pass a number of flags to __init__ from
the boot monitor (eg. LILO). __Init__ accepts the
@@ -295,29 +257,27 @@
Single user mode boot. In this mode ''/etc/inittab'' is
examined and the bootup rc scripts are usually run before
the single user mode shell is started.
Runlevel to boot into.
Boot directly into a single user shell without running any
other startup scripts.
The LILO boot loader adds the word
init__ sets the
@@ -371,9 +331,9 @@
-The kernel sends this signal when the ''KeyboardSignal''
+The kernel sends this signal when the '' KeyboardSignal''
key is hit. It activates the ''kbrequest''
@@ -416,15 +376,16 @@
-Miquel van Smoorenburg (email@example.com), initial manual
+Miquel van Smoorenburg (miquels @ cistron.nl), initial manual
page by Michael Haardt
+(u31b3hs @ pool.informatik.rwth-aachen.de).
getty(1), login(1), sh(1),
shutdown(8), kill __
+runlevel(8), shutdown(8), kill(1),