A run-level is
an HP-UX state of operation in which a specific set of processes is
permitted to run. These processes and default run-levels are defined
in the file /etc/inittab.
The run-levels are:
- Run-level
s
The operating mode system
administrators use (often called single-user
mode). This mode ensures that no one else is on the system
while you are performing system maintenance tasks. In this run-level,
the only access to the system is through the system console by the
user root. The only processes running
on the system can be the shell on the system console, background daemon
processes started by /sbin/rc, and processes
that you invoke. Commands requiring an inactive system (such as /sbin/fsck) should be run in run-level s.
- Run-level
1
Starts a subset of essential
system processes; can also be used to perform system administrative
tasks.
- Run-level
2
The operating mode typically
called multiuser mode. This mode
allows all users to access the system.
- Run-level
3
For NFS servers. In this
mode, NFS file systems can be shared, as required for NFS servers.
For CDE users. In this mode, CDE is active. CDE
is the default desktop on HP-UX 10.30 and later.
- Run-level
4
Sometimes used by optional
software.
Depending on the software installed on your system,
the default run-level is usually run-level 3 or 4. The default run-level for
CDE is 3.
To determine the current run-level of the init process, type:
# 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:
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.
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).
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.