| RCORDER(8) | System Manager's Manual | RCORDER(8) |
NAME
rcorder — print a
dependency ordering of interdependent files
SYNOPSIS
rcorder |
[-gp] [-k
keep] [-s
skip] file ... |
DESCRIPTION
The rcorder utility reads the dependency
declarations of the named files, which are normally the scripts in
/etc/rc.d, and prints the files so that every file
appears after all files it depends on.
rc(8) uses it to decide the order in
which services start.
A file declares its dependencies in one of two ways. Classic rc.subr(8) scripts use comment lines at the top of the file:
# PROVIDE: cron # REQUIRE: LOGIN FILESYSTEMS # BEFORE: securelevel # KEYWORD: shutdown
The lines must be contiguous; the first other line after them ends
the header. Scripts written in the
init_sh(8) dialect instead declare a
service block, whose provide,
require, before and
keyword fields have the same meanings:
service cron {
require LOGIN FILESYSTEMS
keyword shutdown
}
A service block that has no provide field
provides its own name. The block is parsed but never run. A set of files may
mix both forms.
“PROVIDE” names the conditions a file provides, “REQUIRE” the conditions that must be provided first, and “BEFORE” conditions that must come after this file. Several files may provide the same condition; a file requiring it comes after all of them. Files not otherwise constrained keep the order given on the command line.
The options are as follows:
-g- Print the dependency graph in the dot(1) language instead of a list. Edges point in the order files run; edges removed to break a cycle, and requirements nobody provides, are drawn in red.
-kkeep- Print only files that have the keyword keep. May be given more than once, to keep files having any of the keywords.
-p- Print files that may run at the same time on one line. Each line depends only on lines before it.
-sskip- Do not print files that have the keyword skip. May be given more than once.
Filtered files are still used to order the others.
EXIT STATUS
The rcorder utility exits 0 on success,
and 1 if a file cannot be read or the dependencies contain a cycle. A cycle
is broken where it is found and reported, and a complete order is still
printed, so the system can boot. A requirement that no file provides is
reported but is not an error.
EXAMPLES
Print the order in which services start, and the ones stopped at shutdown:
$ rcorder /etc/rc.d/* $ rcorder -k shutdown /etc/rc.d/*
SEE ALSO
HISTORY
An rcorder utility first appeared in
NetBSD 1.5. This implementation was written for
OxideBSD.
| September 25, 2026 | OxideBSD |