---
name: "rc"
section: "8"
platform: "openbsd"
package: "man"
version: "8.0-current-20261101"
release: "OpenBSD 8.0-current (2026-11-01)"
platforms: ["freebsd", "openbsd"]
url: "https://new.carta.tech/rc/8"
---

# rc(8)

command scripts for system startup

## NAME

**rc**, **rc.firsttime**, **rc.local**, **rc.securelevel** – command scripts for system startup

## DESCRIPTION

**rc** is the command script that is invoked by [init(8)](/init/8.md) when the system starts up. It performs system housekeeping chores and starts up system daemons. Additionally, **rc** is intricately tied to the [netstart(8)](/netstart/8.md) script, which runs commands and daemons pertaining to the network. **rc** is also used to execute any [rc.d(8)](/rc.d/8.md) scripts defined in rc.conf.local(8). The **rc.securelevel**, **rc.firsttime**, and **rc.local** scripts hold commands which are pertinent only to a specific site.

All of these startup scripts are controlled to some extent by variables defined in [rc.conf(8)](/rc.conf/8.md), which specify which daemons and services to run.

Before [init(8)](/init/8.md) starts **rc**, it sets the process priority, umask, and resource limits according to the “daemon” login class as described in [login.conf(5)](/login.conf/5.md). It then starts **rc** and attempts to execute the sequence of commands therein.

The first part of **rc** runs an [fsck(8)](/fsck/8.md) with option **-p** to “preen” all 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** is run. However, if the file */fastboot* exists, fsck will not be invoked. The file is then removed so that fsck will be run on subsequent boots.

The second part of **rc** then asks [rc.conf(8)](/rc.conf/8.md) for configuration variables, mounts filesystems, saves [dmesg(8)](/dmesg/8.md) output to the file */var/run/dmesg.boot*, starts system daemons, preserves editor files, clears the scratch directory */tmp*, uses [savecore(8)](/savecore/8.md) to save any possible core image that might have been generated as a result of a system crash, and relinks kernel objects in a random order.

If at any point the boot script fails, [init(8)](/init/8.md) enters single-user mode, allowing the superuser a shell on the console. On exiting this mode, init again invokes **rc**, but this time without performing the file system preen.

Before **rc** starts most system daemons, [netstart(8)](/netstart/8.md) is executed.

**rc.securelevel** is executed by **rc** to start daemons that must be run before the security level changes. Following this, **rc** then sets the security level to '1' if it wasn't set already by **rc.securelevel**. See [securelevel(7)](/securelevel/7.md) for the effects of setting the security level.

If **rc.firsttime** exists, it is executed once and then deleted. Any output is mailed to root.

**rc.local** is executed towards the end of **rc** (it is not the very last as there are a few services that must be started at the very end). Normally, **rc.local** contains commands and daemons that are not part of the stock installation.

## FILES

- */etc/netstart*

  Command script for network startup.

- */etc/rc*

  Command scripts for system startup.

- */etc/rc.conf*

  System daemon configuration database.

- */etc/rc.conf.local*

  Site specific daemon configuration database.

- */etc/rc.d*

  Directory to hold [rc.d(8)](/rc.d/8.md) scripts.

- */etc/rc.d/rc.subr*

  Functions used by the [rc.d(8)](/rc.d/8.md) scripts.

- */etc/rc.firsttime*

  Commands run on the first boot after creation.

- */etc/rc.local*

  Site specific command scripts for system startup.

- */etc/rc.securelevel*

  Commands run before the security level changes.

- */etc/rc.shutdown*

  Commands run at system shutdown.

- */etc/examples/rc.\**

  Examples of site specific scripts.

- */fastboot*

  Tells **rc** not to run [fsck(8)](/fsck/8.md) during the next boot.

- */var/run/dmesg.boot*

  Copy of [dmesg(8)](/dmesg/8.md) saved by **rc** at boot time.

- */etc/random.seed*

  Random seed file read by the bootloader; updated at system startup and shutdown.

- */var/db/host.random*

  Random seed file read by **rc** and the installer on upgrades; updated at system startup and shutdown.

## SEE ALSO

[sysctl.conf(5)](/sysctl.conf/5.md), [securelevel(7)](/securelevel/7.md), [init(8)](/init/8.md), [netstart(8)](/netstart/8.md), [rc.conf(8)](/rc.conf/8.md), [rc.d(8)](/rc.d/8.md), [rc.shutdown(8)](/rc.shutdown/8.md), [rcctl(8)](/rcctl/8.md)

## HISTORY

The **rc** command appeared in Version 4 AT&T UNIX.
