Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ rc2(1M) — SunOS 5.3

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

shutdown(1M)

rc2(1M)

NAME

rc2 − run commands performed for multi-user environment

SYNOPSIS

/sbin/rc2

AVAILABILITY

SUNWcsr

DESCRIPTION

This file is executed using an entry in /sbin/inittab and is responsible for those initializations that bring the system to a ready-to-use state (traditionally state 2) called the "multi-user" state. 

The actions performed by rc2 are found in files in the directory /etc/rc.d and files beginning with S in /sbin/rc2.d.  These files are executed by /usr/bin/sh in ASCII sort−sequence order (see NOTES for more information).  When functions are added that need to be initialized when the system goes into multi-user mode, an appropriate file should be added in /sbin/rc2.d. 

The functions done by the rc2 command and associated /sbin/rc2.d files include:

Setting-up and mounting the user (/usr) file system.  Cleaning up (re-making) the /tmp and /var/tmp directories.  Loading the network interface and ports cards with program data and starting the associated processes. Starting the cron daemon by executing /usr/sbin/cron.  Cleaning up (deleting) uucp locks status, and temporary files in the /var/spool/uucp directory. 

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

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 command can be used only by the super-user. 

Files in /sbin/rc2.d must begin with an S or a K followed by a number and the rest of the file name.  Upon entering run level 2, files beginning with S are executed with the start option; files beginning with K are executed with the stop option.  Files beginning with other characters are ignored. 

EXAMPLES

The following are prototypical files found in /sbin/rc2.d.  These files are prefixed by an S and a number indicating the execution order of the files. 

MOUNTFILESYS

#    Set up and mount file systems
cd /
/sbin/mountall /etc/fstab

RMTMPFILES

#    clean up /tmp
rm −rf /tmp
mkdir /tmp
chmod 777 /tmp
chgrp sys /tmp
chown sys /tmp

uucp

#    clean-up uucp locks, status, and temporary files
rm −rf /var/spool/locks/∗

NOTES

The order in which files are executed is important.  Since they are executed in ASCII sort−sequence order, using the first character of the file name as a sequence indicator will help keep the proper order.  Thus, files starting with the following characters would be:

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

SEE ALSO

shutdown(1M)

Sun Microsystems  —  Last change: 20 Dec 1992

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026