Managing Systems and Workgroups: A Guide for HP-UX System Administrators
Configuring a System
Controlling Access to a System
Chapter 3 253
The default run-level is usually run-level 3 or 4, depending on your
system. The default run-level for CDE is 4.
To determine the current run-level of the init process, type:
who -r
You can add to and change the sequence of processes that HP-UX starts
at each run-level. See “Customizing Start-up and Shutdown” on
page 515. Also see the manpage inittab (4).
You can use SAM to shut down a system and change the current
run-level to single-user state. Use the “Routine Tasks” and “System
Shutdown” menus.
The superuser logged in at the system console can also change the
current run-level with the /sbin/init command, as follows:
1. Warn all users who are currently logged in. Whenever the run-level
of the system is changed, any process that does not have a run-level
entry matching the new run-level will be killed. There is a grace
period of 20 seconds after an automatic warning signal is sent.
2. To change to run-level s, use the shutdown command.
To change to a run-level other than run-level s, use the init
command.
See shutdown (1M) and init (1M).
CAUTION Only use the shutdown command to change to run-level s (that is, do
not
specify /sbin/init s). The shutdown command safely brings your
system to run-level s without leaving system resources in an unusable
state. The shutdown command also allows you to specify a grace period to
allow users to terminate their work before the system goes down. For
example, to enter run-level s after allowing 30 seconds, enter:
shutdown 30
To shut down immediately, enter one of the following:
shutdown now
shutdown 0
Do not use run-level 0; this is a special run-level reserved for system
installation.