Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ rc(8) — DYNIX/ptx 3.0.17

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

halt(8)

init(8)

reboot(8)

savecore(8)

shutdown(8)

fsck(8)

domainname(8)

hostname(8)

ifconfig(8)

RC(8)  —  UNIX Programmer’s Manual

NAME

rc, rc.local, rc.shutdown − command scripts for auto-reboot, daemons, shutdown

SYNOPSIS

/etc/rc
/etc/rc.local
/etc/rc.shutdown

DESCRIPTION

The command script rc controls the automatic reboot process.  The script rc.local holds site-specific commands.  The script rc.shutdown controls shutdowns, halts, and the shutdown portion of manual reboots. 

When an automatic reboot is in progress, rc is invoked with the argument autoboot.  It runs fsck with the −p option to “preen” all the disks of minor inconsistencies resulting from the last system shutdown, and to check for serious inconsistencies caused by hardware or software failure.  If this auto-check and repair succeeds, then the second part of rc runs. 

The second part of rc runs after an auto-reboot succeeds, and also if rc is invoked when a single-user shell terminates (refer to the init(8) man page).  Following a successful fsck, rc executes rc.local (described below), then rc starts all the daemons on the system, preserves editor files, and clears the scratch directory /tmp.

Normally, the first part of rc.local uses domainname to define the machine’s domain name, starts up local daemons, and uses savecore to save any core image generated as a result of a system crash.  The savecore command is included in the rc.local file because the directory in which core dumps are saved is usually site-specific.  The rc.local script also defines the machine’s hostname using hostname and configures network interfaces using ifconfig. 

The script rc.shutdown is always called with a single argument.  It is called from shutdown, halt, and reboot. 

The shutdown command calls rc.shutdown with the argument warn immediately before it sends the terminate signal (SIGTERM) to all non-system processes.  This part of the script can be used by the system administrator to turn off databases and other system-wide applications that need to shut down gracefully.  (Refer to the shutdown(8) man page for details of the sequence of events during system shutdown).  After shutdown sends all processes a kill signal (SIGKILL), it calls rc.shutdown with the argument shutdown. This part of the rc.shutdown script handles any shutdown procedure that requires most processes to be gone, such as unmounting disks.  The only processes alive at this point are the system processes (init, swapper, pagedaemon), shutdown, a shell for rc.shutdown, and any processes that did not die, if any. 

The halt command calls rc.shutdown with the argument halt before halting the last processor, and reboot similarly calls rc.shutdown with the argument reboot before the system is rebooted. 

SEE ALSO

halt(8), init(8), reboot(8), savecore(8), shutdown(8), fsck(8), domainname(8), hostname(8), ifconfig(8)

4BSD

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