rc2(1M) rc2(1M)
rc2 - run commands required for multi-user environment
/etc/rc2
/etc/rc2 is executed via an entry in /etc/inittab and is responsible for
the initializations that bring the system to a ready-to-use state,
traditionally state 2, which is called the "multi-user" state.
/etc/rc2 runs files beginning with S in /etc/rc2.d. These files are
executed by /bin/sh in ascii sort-sequence order (see FILES below for
more information).
Each of these files may also check the state of the corresponding
chkconfig flag for that function. If the state is on, the script starts
that function; if the state is off, it does not start that function.
(See chkconfig(1M)).
The functions performed by the /etc/rc2 command and associated /etc/rc2.d
files include:
Setting and exporting the TIMEZONE variable.
Setting-up and mounting the user (/usr) and other filesystem(s).
Cleaning up (remaking) the /tmp directory.
Initializing the network interfaces, mounting network filesystems,
and starting the appropriate daemon processes.
Starting the cron daemon by executing /etc/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.
The following are simplified examples of the files found in /etc/rc2.d.
The filenames are prefixed by an S and a number indicating the execution
order of the files.
filesystems
# set up and mount filesystems
cd /
fsck -m -c -y
/etc/mount -at efs
Page 1
rc2(1M) rc2(1M)
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/*
The file /etc/TIMEZONE is included early in /etc/rc2, thus establishing
the default time zone for all commands that follow.
See rc0(1M) for the system shutdown procedure.
Files in /etc/rc2.d must begin with an S or a K followed by a number and
the rest of the filename. Upon entering run level 2, files beginning
with S are executed with an argument of start ; if entering run level 2
from some state other than single-user mode (ie: from other than run
level 1 or s), files beginning with K, are first executed with an
argument of stop. Files in /etc/rc2.d are typically symbolic links to
files in /etc/init.d. Files beginning with other characters are ignored.
rc0(1M), shutdown(1M).
PPPPaaaaggggeeee 2222 [ Back ]
|