HP-UX Reference (11i v1 05/09) - 1M System Administration Commands A-M (vol 3)
i
init(1M) init(1M)
NAME
init - process control initialization
SYNOPSIS
/sbin/init [012
3456SsQqa
bc]
DESCRIPTION
The
init daemon and command is a general process spawner. Its primary role is to create processes from
a script stored in the file /etc/inittab
(see inittab(4)). This file usually has init spawn a getty on
each line where users can log in. It also controls autonomous processes required by any particular system.
At boot time,
init is started as a system daemon.
While the system is running, a user-spawned init
directs the actions of the boot init. It accepts a one-
character argument and signals the boot
init with the
kill() system call to perform the appropriate
action.
The arguments have the following effect:
0−6 Place the system in one of the run levels 0 through 6.
abc Process the inittab entries that have the special "run level"
a, b,orc, without changing
the numeric run level.
Qq Re-examine the inittab entries without changing the run level.
Ss Enter the single-user environment. When this level change occurs, the logical system con-
sole
/dev/syscon is changed to the terminal from which the command was executed.
Boot init considers the system to be in a run level at any given time. A run level can be viewed as a
software configuration of the system, where each configuration allows only a selected group of processes to
exist. The processes spawned by boot init for each of these run levels are defined in the
inittab file.
Boot
init can be in one of eight run levels, 0−6, and S
or s. The run level is changed by having a
privileged user run the
init command. This user-spawned init sends appropriate signals to the boot
init.
Boot init is invoked inside the HP-UX system as the last step in the boot procedure. Boot
init first
performs any required machine-dependent initialization, such as setting the system context. Next, boot
init looks for the inittab file to see if there is an entry of the type
initdefault (see inittab(4)). If
an
initdefault entry is found, boot init uses the run level specified in that entry as the initial run
level to enter. If this entry is not in inittab,orinittab is not found, boot
init requests that the
user enter a run level from the logical system console,
/dev/syscon .IfS or s is entered, boot
init
goes into the single-user level. This is the only run level that does not require the existence of a properly
formatted inittab file. If inittab does not exist, then by default the only legal run level that boot
init can enter is the single-user level.
In the single-user level, the logical system console terminal /dev/syscon is opened for reading and writ-
ing, and the command /usr/bin/su , /usr/bin/sh ,or/sbin/sh is invoked immediately. To exit
from the single-user run level, one of two options can be selected:
• If the shell is terminated with an end-of-file, boot init reprompts for a new run level.
• User
init can signal boot init and force it to change the current system run level.
When attempting to boot the system, some processes spawned by boot init may send display messages to
the system console (depending on the contents of inittab). If messages are expected but do not appear
during booting, it may be caused by the logical system console (/dev/syscon ) being linked to a device
that is not the physical system console (/dev/systty ). If this occurs, you can force boot init to relink
/dev/syscon to /dev/systty by pressing the DEL (delete) key (ASCII 127) on the physical system
console.
When boot init prompts for the new run level, you can only enter one of the digits 0 through 6 or the
letter S or s. If you enter S, boot init operates as previously described in single-user mode with the
additional result that /dev/syscon is linked to the user’s terminal line, thus making it the logical sys-
tem console. A message is generated on the physical system console, /dev/systty , identifying the new
logical system console.
When boot init comes up initially, and whenever it switches out of single-user state to normal run states,
it sets the states (see ioctl(2)) of the logical system console, /dev/syscon , to those modes saved in the
file /etc/ioctl.syscon. This file is written by boot init whenever single-user mode is entered. If
HP-UX 11i Version 1: September 2005 − 1 − Hewlett-Packard Company Section 1M−−359