HP-UX System Administrator's Guide: Configuration Management

# who -r
. run-level 3 Mar 5 12:01 3 0 S
You can add to and change the sequence of processes that HP-UX starts at each run-level.
For more information, see the HP-UX System Administrator’s Guide: Overview. Also see
the inittab(4) manpage.
A superuser logged in at the system console can also change the current run-level with
the /sbin/init and /sbin/shutdown commands, 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
use /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
To achieve a true single-user mode with a quiet system, the best tactic is to reboot the
system with an interrupted boot. See hpux(1M) and hpux.efi(1M) and the HP-UX System
Administrator’s Guide: Routine Tasks.
Do not use run-level 0; this is a special run-level reserved for system installation.
For increased security, ensure that the permissions (and ownership) of the files /sbin/
init and /etc/inittab are as follows:
# ll /sbin/init /etc/inittab
-r--r--r-- 1 root sys 2152 Oct 17 01:25 /etc/inittab
-r-xr-xr-x 1 bin bin 1968452 Oct 10 21:31 /sbin/init
Also, the size of inittab should be just a few KB while the size of init should be
one to two MB, as shown.
Controlling Usage and Processes with Run-Levels 39