---
name: "rc.shutdown"
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.shutdown"
---

# rc.shutdown(8)

command script run at system shutdown

## NAME

**rc.shutdown** – command script run at system shutdown

## DESCRIPTION

When the system is shut down using the [reboot(8)](/reboot/8.md) or [halt(8)](/halt/8.md) commands, or when [init(8)](/init/8.md) is signalled to do so, or when a keyboard-requested halt is issued (if the architecture supports it), [rc(8)](/rc/8.md) is invoked with the argument “shutdown”. This document details the actions taken by [rc(8)](/rc/8.md) in such an instance.

Firstly it saves random data for reseeding the kernel random number generator during the next boot. It then stops any daemons defined in the *pkg\_scripts* variable in rc.conf.local(8), as well as [vmd(8)](/vmd/8.md), in that order, by passing them the **stop** argument.

[rc(8)](/rc/8.md) then runs **rc.shutdown**. The administrator should place in this file any commands they wish to have executed during shutdown.

Finally, all [carp(4)](/carp/4.md) interfaces are brought down and then the system shuts down.

If [init(8)](/init/8.md) is exiting single-user mode it will also run the first part of shutdown (saving random data), though not the latter.

## FILES

- */etc/rc.shutdown*

  Command script run at system shutdown.

- */etc/examples/rc.shutdown*

  Example script.

## SEE ALSO

[init(8)](/init/8.md), [rc(8)](/rc/8.md), [rc.conf(8)](/rc.conf/8.md), [reboot(8)](/reboot/8.md)
