Solaris Handbook for Sun Peripherals

Run Levels

The run level defines what services and resources are available to users. A system can be in only one run level at a time. See the table below for a description of the various run levels.

Run level numbers are used with the init and shutdown commands to control system services. Use the init command to shut down a system that does not have multiple users or clients. In addition, use the init command to change run levels. You can also specify the run level as an argument to the shutdown command with the -i option.

Table 1-3 Run Levels

Run Level 

System State 

Description 

Monitor mode 

The operating system is shut down. The system displays the ok prompt. It is safe to turn off system power.

Multiuser mode 

The operating system is fully booted; all required processes are started to support multiple users, network access, file systems, event logging, and so on. It is not safe to turn off system power. 

Automatic power-off 

The operating system is shut down and power is automatically turned off (on supported systems only). 

Reboot  

The operating system is brought to run level 0 and then to the default run level as specified in the /etc/inittab file (typically run level 3).

s or S or 1 

Single-user mode 

The operating system is in maintenance mode. In this mode, only a few processes are started for basic system functionality. Only the /, /usr, and /proc file systems are mounted, and no nfs file systems are shared. Only superuser is allowed to log in.

It is not safe to turn off system power. 

Use the who command to determine your run level.

The following example shows a system that is in multiuser mode (run level 3).


# who -r
. run-level 3 Apr 24 10:44 S 0 S


Note -

who is not a valid command when you are at run level 0.


To Shut Down a Single-User System Using init

This section describes how to shut down a single-user system.


Note -

init does not send a warning message to users.



Note -

Be sure to prepare the system first. Refer to "To Prepare the System" for more information.


  1. Become superuser.

  2. Stop all applications and close any open files on the system.

  3. Shut down the system.


    # init 0
    

    This command writes data to the disk, kills all active processes, brings the system down to the monitor mode, and displays the ok prompt.

  4. If you are asked for confirmation, type y.


    ok Do you want to continue? (y or n): y 
    

  5. If you are installing a new SCSI device continue with Step 6. If you are installing a new card continue with instructions in Chapter 5, Setting Up an Option Card".

  6. Reset the SCSI bus with the reset command followed by a Stop-A:


    ok reset 
    Immediately press <Stop-a> once you see the banner on your screen.

    The reset command (reset-all on some systems) resets the SCSI bus and memory to ensure a effective probe-scsi search. The Stop-A key sequence interrupts the reboot process that normally results from the reset command. This way you remain at run level 0 to perform the probe-scsi command.


    Note -

    Be sure to turn on all SCSI devices, such as disk and tape drives, before you attempt to use the probe-scsi or probe-scsi-all commands. The probe-scsi command can detect connected SCSI devices only if they are turned on.


  7. List the SCSI target IDs that are currently used on the SCSI bus by typing:


    ok probe-scsi 
    

    If you have more than one SCSI bus on your system, use the probe-scsi-all command. This command probes for all SCSI devices on every SCSI bus.

  8. Choose an unused SCSI target ID for your new device.

    Note the target IDs that are already assigned and choose an unused target ID for your new device. For more information on selecting a target ID see Appendix A, SCSI Addressing".

  9. After the ok prompt is displayed, turn off the power to the system and then to all external peripheral devices.

You are now ready to install the peripheral device. Refer to the documentation that accompanies your hardware and the appropriate section in this manual: