Manual page for init(1M)
init, telinit - process control initialization
is a general process spawner.
Its primary role is to create
processes from information stored in the file
Run Level Defined
At any given time, the system is in one of eight possible run levels.
A run level is a software configuration
under which only a selected group of processes exists.
Processes spawned by
for each of these run levels are defined in
can be in one of eight run levels,
and S or s
(S and s are identical).
The run level changes when a privileged user runs
This sends appropriate signals to the original
spawned by the operating system at boot time,
saying which run level to invoke.
init and System Booting
When the system is booted,
is invoked and the following occurs.
First, it reads
to set environment variables.
This is typically where
and locale-related environments such as
then looks in
usually uses the run level specified in that entry
as the initial run level to enter.
- does not exist
asks the user to enter a run level from the
- S or s
init goes to the
In this state, the system console device
is opened for reading and writing and the command
Use either init or telinit to
change the run level of the system.
Note that if the shell is terminated (using an end-of-file),
only re-initializes to the single-user
state if /etc/inittab does not exist.
enters the corresponding run level.
are reserved states for shutting the system down.
are available as multi-user operating states.
If this is the first time since power up that
has entered a run level
other than single-user state,
init first scans
for boot and bootwait entries
These entries are performed before any other processing of
takes place, providing that the run level entered matches that of the entry.
In this way any special initialization of the
operating system, such as mounting
file systems, can take place before users are allowed onto
and executes all other entries
that are to be processed for that run level.
To spawn each process in
reads each entry and for each entry that should be
respawned, it forks a child process.
After it has spawned all of the processes specified by
waits for one of its descendant processes to die,
a powerfail signal, or a
signal from another
init or telinit process
to change the system's run level.
When one of these conditions occurs,
New entries can be added to
at any time; however,
still waits for one of the above three conditions to occur
before re-examining /etc/inittab.
To get around this,
comes up at boot time and whenever the system changes from
the single-user state to another run state, init sets the
states of the console to those modes saved in the
init writes this file whenever the
single-user state is entered.
Run Level Changes
When a run level change request is made,
sends the warning signal (SIGTERM) to all processes that are
undefined in the target run level.
waits five seconds before forcibly terminating these processes by sending a
kill signal (SIGKILL).
receives a signal telling it that a
process it spawned has died, it records the fact
and the reason it died
if it exists (see
A history of the processes spawned is kept in
If init receives a
for special entries of the type
These entries are
invoked (if the run levels permit) before any further processing
In this way
can perform various cleanup and recording functions
during the powerdown of the operating system.
Default values can be set for the following flags in /etc/default/init.
Either specifies the timezone information (see
the name of a timezone information file
Character characterization information.
Monetary formatting information.
Numeric formatting information.
Time formatting information.
If set, all other LC_* environmental variables take-on this value.
is not set, and any particular LC_* is also not set,
the value of
is used for that particular environmental variable.
which is linked to
is used to direct the actions of
It takes a one-character argument and signals init
to take the appropriate action.
Go into firmware.
Put the system in system administrator
All file systems are mounted.
Only a small set of essential kernel
processes are left running.
This mode is for administrative tasks such as
All files are accessible and no users are logged in on the
Put the system in multi-user mode.
All multi-user environment terminal processes
and daemons are spawned.
This state is commonly referred to as the
Extend multi-user mode by making local resources available over the network.
Is available to be defined as an alternative
multi-user environment configuration.
It is not necessary for system operation and is usually
Shut the machine down so that it is safe to remove the power.
Have the machine remove power, if possible.
Stop the operating system and reboot to the state defined by the
- a, b, c
process only those
entries having the a,
run level set.
These are pseudo-states, which may be defined
to run certain commands,
but which do not cause the current run level to change.
- Q, q
- S, s
Enter single-user mode.
When this occurs, the terminal that executed this command becomes the
This is the only run level that doesn't require the existence of
a properly formatted
If this file does not exist,
then by default, the only legal run level that
can enter is the single-user mode.
When the system comes up to S or s,
file systems for users' files are not mounted and only
essential kernel processes are running.
When the system comes down to S or s,
all mounted file systems remain mounted, and all processes started by
init that should
only be running in multi-user mode are killed.
In addition, any process that has a utmp
entry will be killed.
This last condition insures that all port monitors started by the SAC
are killed and all services started by these port monitors, including
ttymon login services, are killed.
Other processes not started directly by init will remain running.
For example, cron remains running.
controls process dispatching by init
history of all logins since file was last created
system console device
finds that it is respawning an entry from
more than ten times in two minutes, assumes that
there is an error in the command string in the entry,
and generates an error message on the system console.
It will then refuse to respawn this entry until either
five minutes has elapsed or it receives a signal from
from eating up system resources when someone makes a
typographical error in the
file, or a program is removed that is referenced in
can be run only by a privileged user.
state must not be used indiscriminately in /etc/inittab.
When modifying this file, it is best to avoid adding this
state to any line other than initdefault.
If a default state is not specified in the initdefault
entry in /etc/inittab,
state 6 is entered.
Consequently, the system will loop by going to firmware
and rebooting continuously.
If the utmp file cannot be created when booting the system,
the system will boot to state ``s'' regardless of
the state specified in the initdefault entry in
This can occur if the /var file system is not accessible.
Created by unroff & hp-tools.
© by Hans-Peter Bischof. All Rights Reserved (1997).
Last modified 21/April/97