rc2(ADM)


rc2 -- run commands performed for multiuser environment

Syntax

/etc/rc2

Description

This file is executed via an entry in /etc/inittab and is responsible for those initializations that bring the system to a ready-to-use state, traditionally state 2, called the ``multiuser'' state.

The actions performed by /etc/rc2 are found in files in several directories and are executed in a prescribed order to ensure proper initialization. /etc/rc2 performs the following functions in the order in which they appear:

  1. Runs the system setup scripts in the directory /etc/rc2.d. Some of the scripts in this directory are front-end scripts to run other scripts in the subdirectories of /etc/rc.d.

  2. Runs the system setup scripts in the directory /etc/idrc.d, which contains scripts from the driver packages linked from /etc/conf/rc.d.

  3. Runs system setup scripts in the directory /etc/rc.d. This directory exists for XENIX compatibility. It contains subdirectories named with the numerals 0 to 9. Each subdirectory contains scripts that perform certain system startup functions (for example, the directory /etc/rc.d/3 contains scripts that handle crash recovery). All of these scripts are run by the front-end scripts in /etc/rc2.d. Any other individual scripts in the directory are run.

  4. Runs the script /etc/rc. This script exists for XENIX compatibility. It is an empty file, but you can add initialization commands to the file. These commands are run last during the initialization.
The setup scripts are executed by /bin/sh in ASCII sort-sequence order (see ``Files'' for more information). When functions are added that need to be initialized when the system goes multiuser, an appropriate file should be added in /etc/rc2.d.

Other functions can be added, as required, to support the addition of hardware and software features.

Warning

These files are intended for execution by init. They must never be executed directly by a user.

Files

Files in /etc/rc.d are executed in ASCII collation sequence order. Thus, files starting with the following characters would run accordingly:

[0-9] earliest
[A-Z] early
[a-n] later
[o-z] last

Files in /etc/rc.d that begin with a dot (.) will not be executed. This feature can be used to hide files that are not to be executed for the time being without removing them.

The files in /etc/rc2.d are run in the order when sorted on their filenames from the second character onward (according to the ASCII collation sequence). The first character of the filename determines how the files are run on entering run level 2:


K*
scripts executed in serial sequence of their sort order when stop is specified to prc_sync(ADM)

S*
scripts executed in serial sequence of their sort order when start is specified to prc_sync

P*
scripts which prc_sync executes in parallel with other P* scripts to which they are adjacent when sorted

I*
interactive scripts for which prc_sync will wait until they complete executing and exit
Files beginning with other characters are ignored.

Important scripts in /etc/rc2.d are:


P00SYSINIT
runs /etc/rc.d/0* and /etc/rc.d/1* scripts

I01MOUNTFSYS
mounts filesystems and runs /etc/rc.d/2* scripts

P03RECOVERY
runs /etc/rc.d/3* scripts

P15HWDNLOAD
runs /etc/rc.d/5* scripts

P16KERNINIT
runs /etc/rc.d/6* scripts

P20sysetup
generates the system ID file (/etc/systemid)

P70uucp
cleans up uucp(C) locks, status, and temporary files

P75cron
starts the cron(C) daemon

P87USRDAEMON
runs /etc/rc.d/7* scripts

P88USRDEFINE
runs /etc/rc.d/8* scripts

P90RESERVED
runs /etc/rc.d/9* scripts

S02audit
initiates auditing

See also

prc_sync(ADM), shutdown(ADM), init(M), rc0(ADM)

``Starting and stopping the system'' in Starting and stopping the system


© 2005 The SCO Group, Inc. All rights reserved.
SCO OpenServer Release 6.0.0 -- 03 June 2005