14.7 Runlevels

   

A runlevel is a state of the system showing which daemons and services are available at a particular time. HP-UX is in one of the eight runlevels at all times. These runlevels are 0 to 6, s, and S. The system default runlevel is determined by the initdefault entry in the /etc/inittab file. These runlevels are described in Table 14-3.

Table 14-3. HP-UX Runlevels
Runlevel Description
Reserved for shutdown. When the system goes to this runlevel, it stops all processes and brings the system to a halted state.
s This is a single- user runlevel and is used for system-administration- related tasks . Only one physical system console can be used. For this reason, it is called a single-user runlevel. The daemons available in this runlevel are those started by init having the sysinit keyword in the /etc/inittab file and any other daemon directly started by the HP-UX kernel.
S This is similar to the single-user runlevel, the only difference being that the terminal you are logged into acts as the system console.
1 This starts some essential system processes and mounts the file system but still in single-user mode. This runlevel is also used for system administration tasks.
2 This is a multiuser runlevel; most of the system daemons and services are started at this runlevel.
3 Network services are started and NFS file systems are exported. This also starts the CDE graphical environment (for those users using it).
4 Activates the graphical user interface (GUI) for those users using the older HP VUE graphical environment.
5 Available for any user-defined services.
6 Available for any user-defined services.

Changing Runlevel

The runlevel of the system can be changed using the init command. The first argument to the command determines the new runlevel. If you are working in single-user mode for some maintenance work and want to bring the system into multiuser mode, you can use the following init command to bring the system to runlevel 3.

 init 3 

However, you should not use init S from a higher runlevel to go into single-user mode. This does not terminate other system activities and does not bring the system into single-user mode.

The shutdown command can also be used to bring the system into single-user mode. The reboot command changes the runlevel to 0 and reboots the system.

Determine Current Runlevel

You have already used the who command to determine who is currently logged into the system. Using who with the -r option determines the current system runlevel.

 # who -r .       run-level 3  Sep 26 03:51    3    0    S # 

The last three fields show the current system state, the number of times the system has been in this state, and the last runlevel state. These fields change each time you change the runlevel of the system.


   
Top


HP Certified
HP Certified: HP-UX System Administration
ISBN: 0130183741
EAN: 2147483647
Year: 2000
Pages: 390
Authors: Rafeeq Rehman

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net